警告:strlen() 期望参数 1 是字符串,数组在 file.. 中给出



我有这个错误:

警告:strlen(( 期望参数 1 是字符串,数组给出/include/functions/general.php 在第 159 行

第 159 行是:

if ((strlen($value) > 0) && ($key != tep_session_name()) && ($key != 'error') && (!in_array($key, $exclude_array)) && ($key != 'x') && ($key != 'y')) {

你能帮我解决这个问题吗?

strlen()仅适用于字符串。strlen()文档中

strlen()在数组上执行时返回NULL,并发出E_WARNING级错误。


如果您有数组,请使用count()来计算元素:

if (count($value) > 0)

最新更新