PHP trim words

function trimwords($a,$b){$l=strlen($a);if($l > $b) {$last_space=strrpos(substr($a,0,$b),' ');return substr($a,0,$last_space)....;}else{return $a; }}
echo trimwords($text,70);