0
PHP: Can anyone explain that code?
$letters = array ("a", "b", array("c", "d"), "e"); echo (count($letters, 1)); The output is 6, but why? I know the count() function but don't know what the second parameter (in this case 1) does. Can someone explain?
3 Answers
+ 2
the 1 will probably be the position of element that should be printed
+ 2
The second (optional) parameter is set to 1, so count() will count recursively.
https://www.php.net/manual/en/function.count.php
0
*AsterisK* position of an element of the array?