Programmer's Wiki
Advertisement

Determining the amount of elements in an array.

JavaScript[]

var haystack = ['fish', 'needle']
console.log(haystack.length);

PHP[]

print count(['fish', 'needle']);

See also[]

  • strlen - Determining the amount of characters in a string
Advertisement