Page 1 of 1

Return Length of Array, (js: array.length, how in php?)

Posted: Sat Nov 10, 2007 7:08 pm
by Jonah Bron
Hi,

How do I access the amount of fields in an array? In Javascript, it is arrayname.length. What is it in PHP?

Thanks

Posted: Sat Nov 10, 2007 7:16 pm
by Christopher
Arrays are not objects in PHP:

Code: Select all

$length = count($myarray);

Posted: Sat Nov 10, 2007 7:19 pm
by Jonah Bron
Ah. Thanks. Thats it :D