Why one? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
26th Mar 2019, 7:24 PM
Sławek J.
2 Answers
+ 3
When the parameter is neither an array nor an object with implemented Countable interface, 1 will be returned. https://www.php.net/manual/en/function.count.php#refsect1-function.count-returnvalues
26th Mar 2019, 8:28 PM
Diego
Diego - avatar
+ 11
So "count" count elements in array only, if it is not array it display 1?
26th Mar 2019, 7:51 PM
Sławek J.