问题
I have this error:
Warning: strlen() expects parameter 1 to be string, array given in /includes/functions/general.php on line 159
Line 159 is:
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?
回答1:
strlen() only works for strings. From the strlen() documentation:
strlen()returnsNULLwhen executed on arrays, and anE_WARNINGlevel error is emitted.
If you have an array, use count() to count the elements:
if (count($value) > 0)
来源:https://stackoverflow.com/questions/50143398/warning-strlen-expects-parameter-1-to-be-string-array-given-in-file-in-li