Array length: Difference between revisions
Content added Content deleted
(Created page with "Determine the amount of elements in an array. == PHP == <lang php>print count(['apple', 'orange']); // Returns 2</lang> == See also == * String length") |
No edit summary |
||
Line 1:
Determine the amount of elements in an array.
== JavaScript ==
<lang javascript>console.log(['apple', 'orange'].length);</lang>
== PHP ==
|
Revision as of 16:13, 26 September 2015
Determine the amount of elements in an array.
JavaScript
<lang javascript>console.log(['apple', 'orange'].length);</lang>
PHP
<lang php>print count(['apple', 'orange']); // Returns 2</lang>