Question

I'm running PHP 5.3.8 on my local, 5.2.17 on my remote.

strstr() works fine on my local, but when loaded in remote it returns nothing. Even error reporting doesn't say anything.

A simple use of it:

echo strstr('1234567890', '3', true);

should return 12. Instead gives nothing. I'm lost for ideas at this point. How could two identical scripts return different results?

Is it secretly turned off? Or is there a setting I don't know about? Any help much appreciated, thanks.

Was it helpful?

Solution

The third param of strstr was introduced in PHP 5.3.0 so you cannot use this param in your remote server which has PHP 5.2.x

Link here http://php.net/manual/en/function.strstr.php (notice the Change log section)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top