Arty Ziff Posted April 30, 2011 Share Posted April 30, 2011 Suppose I have a multidimensional array... $AnArray[1][$j] I'd like to count how many $j So if $AnArray = array(0 => array('orange', 'banana', 'apple'), 1 => array('carrot', 'collard', 'pea','tuna')); The count I'm after would be 4... Link to comment https://forums.phpfreaks.com/topic/235162-counting-multidimensional-arrays/ Share on other sites More sharing options...
cyberRobot Posted April 30, 2011 Share Posted April 30, 2011 echo count($AnArray[1]); Link to comment https://forums.phpfreaks.com/topic/235162-counting-multidimensional-arrays/#findComment-1208610 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.