Multidimensional array judgment

Source: Internet
Author: User
CITY[X] [y]
x Save the ID of the Save
Y Save the ID of the city in X province
If there is no data under city[x]
Indicates that the province is empty and can be deleted
Otherwise, how can we not solve?


Reply to discussion (solution)

Count (city[x]) = = 0

Count (city[x]) = = 0


Is this a statement that can be deleted? Can you write a full-scale point? Thank you

foreach ($city as $key, $item) {  if (count ($ITRM) <== 0) unset ($city [$key]);}

foreach ($city as $key, $item) {  if (count ($ITRM) <== 0) unset ($city [$key]);}


Kazakhstan is good, but I want to tell you if there's something wrong with that code, haha.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.