0

My log file show error:

2016-02-19T04:20:31+00:00 ERR (3): Strict Notice: Only variables should be passed by reference  in /home/..../controllers/IndexController.php on line 17

2016-02-19T04:20:31+00:00 ERR (3): Warning: explode() expects parameter 2 to be string, array given  in /home/.../controllers/IndexController.php on line 18


$path=explode('index/index/path/',array_shift(explode('?',@$_SERVER['REQUEST_URI'])));<br>
$ex = explode('/id/', $path);

Please tell me how can fix!

0

you also should explain what you want to achieve actually, but I can at least try to resolve your errors:

you are not allowed to pass the explode result directly to the array_shift function. This is because array_shift manipulates the array and using the result of explode, there is no variable where this change can be saved in.

$requestUri = explode('?', $_SERVER['REQUEST_URI']);
$path=explode('index/index/path/',array_shift($requestUri);

The second error is simply that $path is an array, but explode needs a string. To solve this I would need to know what you are trying to do here?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.