zend framework - PHP - strstr function problem -


good day all. using zend+smarty, don't think framework has thing problem. have following scenario:

     script gets string specified site using api. string retrieved corectly i'll assign string variable:       $string = 'string retrieved api.';      $string = strstr($string, "<?xml", false);       libxml_use_internal_errors(true);      $xml = simplexml_load_string($body); 

sounds ok, looks ok. problem.

when use on our local test machine works dream. no problem @ all. on other hand, on production machine this:

warning: wrong parameter count strstr() in /home/prj/include/databaseobject/ctrl.php on line 720 (this strstr line).

i checked strings before strstr on 2 machines , identical. on second server after strstr line string becomes empty (on other 1 correctly transformed).

i don't it... code same. string same. bit strange me.

the third paramater "before needle" - boolean value - added in php 5.3. it's production server running earlier version.

see php.net

strstr ( string $haystack , mixed $needle [, bool $before_needle = false ] )

  • 5.3.0 added optional parameter before_needle.

Comments