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
Try strtok:
$token = strtok($str, '?');
Note that the second parameter is a list of separators and not a separator string.