Rumah >pembangunan bahagian belakang >tutorial php >多维数组判断
city[x] [y]
x储存省的id
y储存x省的城市的id
如果city[x]下没有数据
说明省是空的 可以删除
反之不能 怎么解?
count(city[x]) == 0
count(city[x]) == 0
foreach($city as $key->$item) { if(count($itrm) <== 0) unset($city[$key]);}
foreach($city as $key->$item) { if(count($itrm) <== 0) unset($city[$key]);}