1

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?

Ronan Boiteau
  • 9,608
  • 6
  • 34
  • 56
gold1s
  • 21
  • 3

1 Answers1

2

strlen() only works for strings. From the strlen() documentation:

strlen() returns NULL when executed on arrays, and an E_WARNING level error is emitted.


If you have an array, use count() to count the elements:

if (count($value) > 0)
Ronan Boiteau
  • 9,608
  • 6
  • 34
  • 56