I\'m trying to build a function to trim a string is it\'s too long per my specifications.
Here\'s what I have:
function trim_me($s,$max) { if (s
function trim_me($s,$max) { if( strlen($s) <= $max) return $s; return substr($s,0,strrpos($s," ",$max-3))."..."; }
strrpos is the function that does the magic.