Only Variables can be passed by reference error

ぐ巨炮叔叔 提交于 2019-11-28 01:55:13

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!