fishfin Posted June 14, 2008 Share Posted June 14, 2008 I've got a question. Is there any way for me to check how many values I have in an array? Link to comment https://forums.phpfreaks.com/topic/110190-solved-number-of-values-in-array/ Share on other sites More sharing options...
xtopolis Posted June 14, 2008 Share Posted June 14, 2008 <?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. Link to comment https://forums.phpfreaks.com/topic/110190-solved-number-of-values-in-array/#findComment-565469 Share on other sites More sharing options...
fishfin Posted June 14, 2008 Author Share Posted June 14, 2008 Thanks! that's what I needed! Link to comment https://forums.phpfreaks.com/topic/110190-solved-number-of-values-in-array/#findComment-565470 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.