Tutorial Append Non-Breaking Space Between Last Two Words

function word_wrapper($text,$minWords = 3) { $return = $text; $arr = explode(' ',$text); if(count($arr) >= $...


function word_wrapper($text,$minWords = 3) {
$return = $text;
$arr = explode(' ',$text);
if(count($arr) >= $minWords) {
$arr[count($arr) - 2].= ' '.$arr[count($arr) - 1];
array_pop($arr);
$return = implode(' ',$arr);
}
return $return;
}


?>

Reference URL

Hot in Week

Popular

Archive

item