Only Variables can be passed by reference error

前端 未结 2 1284
一生所求
一生所求 2020-12-07 01:26

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

2条回答
  •  臣服心动
    2020-12-07 01:51

    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.

提交回复
热议问题