Home > Article > Backend Development > PHP错误:Only variables should be passed by reference
PHP错误:Only variables should be passed by reference
原因在于PHP5.3版本开始,array_shift不支持函数返回
$tag_sel = array_shift(explode(' ', $tag));
上述写法改成下面写法
$tag_tmp = (explode(' ', $tag)); $tag_sel = array_shift($tag_tmp); //$tag_sel = array_shift(explode(' ', $tag));