Jump to content

[SOLVED] number of values in array


fishfin

Recommended Posts

<?php
echo count($array);
?>

 

You can also assign it to a variable, good to use in for loops.

<?php
var $x = count($array);

for($i=0;$i<$x;$i++) .....  as oppossed to :   for($i=0;$i<count($array);$i++)
?>

saves having to do the math for the same thing x number of times.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.