警告:strlen()期望参数1为字符串,文件中给定的数组... [英] Warning: strlen() expects parameter 1 to be string, array given in file... in line
本文介绍了警告:strlen()期望参数1为字符串,文件中给定的数组...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有此错误:
警告:strlen()期望参数1为字符串,数组形式为 /includes/functions/general.php,第159行
Warning: strlen() expects parameter 1 to be string, array given in /includes/functions/general.php on line 159
第159行是:
if ((strlen($value) > 0) && ($key != tep_session_name()) && ($key != 'error') && (!in_array($key, $exclude_array)) && ($key != 'x') && ($key != 'y')) {
您能帮我解决这个问题吗?
Could you help me solving this problem?
推荐答案
strlen()
在数组上执行时返回NULL
,并发出E_WARNING
级错误.
strlen()
returnsNULL
when executed on arrays, and anE_WARNING
level error is emitted.
如果您有数组,请使用 count()
计算元素:
If you have an array, use count()
to count the elements:
if (count($value) > 0)
这篇关于警告:strlen()期望参数1为字符串,文件中给定的数组...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文