How can I resolve this warning in PHP7.2 ?
count(): Parameter must be an array or an object that implements Countable
Just check variable before passing to count() ?
How can I resolve this warning in PHP7.2 ?
count(): Parameter must be an array or an object that implements Countable
Just check variable before passing to count() ?
Yes, you can check it for example by
if (is_array($variable) && count($variable) > 0) { ... }