Sorry i it is duplicated, but I don't seem to find the exact scenario I need to clarify.
So my question is why this:
var = array ();
echo count (var);
prints 0.
and this:
var = array (array());
echo count (var);
prints 1?
Thanks!
Sorry i it is duplicated, but I don't seem to find the exact scenario I need to clarify.
So my question is why this:
var = array ();
echo count (var);
prints 0.
and this:
var = array (array());
echo count (var);
prints 1?
Thanks!
Because you've put an array into an array. Even if that inner array is empty, it's still SOMETHING.
It's like putting an empty plastic bag into another plastic bag. That outer bag now contains one item: another plastic bag.