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... Quote 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]); Quote Link to comment https://forums.phpfreaks.com/topic/235162-counting-multidimensional-arrays/#findComment-1208610 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.