I have a simple array which contains name of all the countries and total number of users registered on my website from that each country. It's something like this:
Array (
[1] => Array ( [name] => Afghanistan [total] => 3 )
[2] => Array ( [name] => Albania [total] => 0 )
)
And, I'm trying to delete array elements (countries) which have 0 users.
I've tried with this code and it's not working:
foreach($country as $row) {
if ($row['total'] == 0) {
unset($row);
}
}
What is wrong with this code?