1 0 Tag Archives: space
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
Leave a Comment