which php version you using with ? -
Mitul Dabhi
Sep 30 '16 08:16
@Mitul its PHP Version 5.2.9 -
debugger
Sep 30 '16 08:17
//custom function for strstr with
function strstr_($haystack ,$needle,$before_needle){
if($before_needle)
return str_replace(strstr($haystack ,$needle),"",$haystack );
else
return strstr($haystack ,$needle);
}
//use same as strstr for php 5.3.0
echo strstr_($url_piece,"/",true);
//strstr function compitable with latest option before_needle without use of strstr
function str_str($haystack,$needle,$before_needle=false)
{
if($before_needle)
return substr($haystack,0,strpos($haystack, $needle));
else
return substr($haystack,strpos($haystack, $needle));
}