How can we get the total no.of elements in an recursive array by using a function?

$food = array('fruits' => array('orange', 'banana', 'apple'),
              'veggie' => array('carrot', 'collard', 'pea'));

// recursive count
echo count($food, COUNT_RECURSIVE); // output 8

// normal count
echo count($food); // output 2

 

0   0
Padmaja v
profile inserts 23rd April 2024

At We, our main goal is to Tungaloy Inserts experience you stress-free purchasing Seco Inserts time Carbide Milling Inserts that saves your time and money. We are looking forward to working with you. Please contact us today for complete details of We lathe inserts.

Write a comment ...
Post comment
Cancel
profile Jaxon 19th April 2024

This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free.Please continue this great work and I look forward to more of your awesome blog posts.It is a great website.. The Design looks very good.. Keep working like that!. https://www.posterprintcenter.com/

Write a comment ...
Post comment
Cancel

Please rotate your device

We don't support landscape mode on your device. Please rotate to portrait mode for the best view of our site