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
Try:
$counter = 0; foreach ($Contents as $item) { something your code ... $counter++; } $total_count=$counter-1;