Concept
How can you count the elements in a PHP array?
ComputerScienceOne / Useful Functions
"There are dozens of useful functions PHP defines that can be used with arrays. We’ll only highlight a few of the more useful ones. First, the count() function can be used to compute how many elements are stored in the array.\n\n$arr = array(10, 20, 30);\n\n$n = count($arr); //n is 3"
Related Ideas
- Which PHP functions return an array’s keys and values?ComputerScienceOne · Useful Functions
- How can you iterate over indexed and associative arrays in PHP?ComputerScienceOne · Iteration
- How do you create and index arrays in PHP?ComputerScienceOne · Creating Arrays
- How are elements added to the next available integer index in a PHP array?ComputerScienceOne · Removing Elements
- How can you extract array keys and values and compare arrays in PHP?ComputerScienceOne · Iteration