How to calculate how many items in a foreach?
I want to count total rows.
foreach ($Contents as $item) { $item[number];// if there are 15 $item[n
foreach ($array as $value) { if(!isset($counter)) { $counter = 0; } $counter++; }
//Sorry if the code isn't shown correctly. :P
//I like this version more, because the counter variable is IN the foreach, and not above.