RsD0p9BK
1/12/2015 - 5:13 AM

strstr.php

$string = "/gallery/image?a=b";
$string = strstr($string, '?', true); 
// Returns /gallery/image
 
// http://stackoverflow.com/questions/1830992/php-trim-string-at-a-particular-character
// http://stackoverflow.com/questions/2216710/get-text-after-needle