Syntax
PHP Count Items Syntax
In PHP, count items: counts array elements — count($nums)
Quick Answer
- Syntax
count($nums)
PHPSyntax
Count Items
Counts array elements.
How to count items in PHP
- Open your PHP file or editor.
- Copy the example, then replace its sample names and values for your code.
PHP Count Items Syntax
Use count($nums).
Related Syntax References
Frequently asked questions
What is the PHP syntax for count items?
Use this pattern: count($nums)
Can I copy this PHP code example?
Yes. Use Copy code and adapt the example to your program.
Is this PHP syntax different on Mac or Windows?
No. The language syntax is the same across operating systems.
Official source · How we verify