post icon

How to get string from the last occurrence of the space in the string?

$string = substr($row[vodtitle],0,40);
$string = str_replace("-","",$string);
echo substr($string, 0, strrpos( $string, ' ') ); //Hello World

Comments are closed.

Leave a comment