Well on my own server, the function str_replace($search, $replace, $subject) by default replaces only the first occurrence of the matched string. But on other servers, I've encountered issues when all occurrences of the matched substring is replaced. Consider the following example:
$queryString = "/admincp/users/edit/1";
$query = str_replace("/", "", $queryString);
echo $query;
// on my server, the output is admincp/users/edit/1
// on another user's server, the output is admincpuseredit1
This is kinda strange, I never realized this could be an issue until a few users of my script reported a glitch that prevents them from viewing any pages with longer url. Is there an explanation to the phenomenon? Or is it just my server or the other server malfunctioning? Does it have anything to do with PHP version? Please lemme know if you know the answer, thx.