An error occurred in script \'/usr/local/apache2/htdocs/read.php\' on line 197: Only variables should be passed by reference (line 196 is
$ext = strtolo
You need to make the result of explode() a variable before you pass it on
$var = explode('.',$filename);
$ext = strtolower(array_pop($var));
That code is passing the result of the explode
function (a value) into array_pop, but array_pop
expects an array variable (by reference), not a value. (The &
in the array_pop
declaration tells us that it's expecting to accept a reference.)
You can fix it by using an array variable to store the result of explode
, and then passing that into array_pop
.