出现Strict Standards: Only variables should be passed by reference in的解决方法

出现Strict Standards: Only variables should be passed by reference in的解决方法

代码报错:

<br />
<b>Strict Standards</b>: Only variables should be passed by reference in <b>/xxxxx/xxxxApi.php</b> on line <b>41</b><br />
<br />
<br />
<b>Strict Standards</b>: Only variables should be passed by reference in <b>/xxxxx/xxxxApi.php</b> on line <b>41</b><br />
<br />
<br />
<b>Strict Standards</b>: Only variables should be passed by reference in <b>/xxxxx/xxxxApi.php</b> on line <b>41</b><br />
<br />

原因:

我的PHP版本是5.4.19,PHP5.3以上默认只能传递具体的变量,而不能通过函数返回值传递,所以这段代码中的explode就得移出来重新赋值了

 

解决办法:


$tag_sel = array_shift(explode(' ', $tag));
修改为:
$tagArr = explode(' ', $tag); $tag_sel = array_shift($tagArr);
 
posted @ 2019-11-21 10:26  KoMiles  阅读(732)  评论(0编辑  收藏  举报