The number of elements in the PHP array is proposed to be determined by the count () function. In most cases, this is a simple and practical way. A regular site does not require special logic, does not contain complex systems of objects, so using the count () function will be enough.
In cases where arrays act as collections of objects or are semantically interconnected data structures, the calculation of quantity is determined by the meaning of this data.
Syntax and use of the count () function
The result of the function is the number of elements contained in the array that are passed as a parameter. The following is an example of PHP: counting the number of elements in an array.
13 . - . . 13 - 2 + 1 = 12, count() . .
, . , count() - . PHP , . .
, . .
, - «», - « » « ». , :
. PHP . . count() , - .
- . . : ( , ). , , .
, count(), PHP . : , , , , , ? , ?
, :
, . PHP , , . , .