Is there a php string function to trim a string after a particular character. I had a look on the php.net site and did a google search but couldn\'t find anything. The only
function imaginary_function($string, $char) { $index = strpos($char, $needle); if ($index === false) { return $string }; return substr($string, 0, $index); }
An excellent, official list of string manipulation functions is available here.