Ask a question about the foreach () function

Source: Internet
Author: User
Ask the question of a foreach () function
PHP warning:invalid argument supplied for foreach () in C:\inetpub\wwwroot\hp\client_list.php on line 126


foreach ($idcheck as $u + $s) //This type of foreach will error


What method does not change the original sentence (the original sentence in the site in many places to use) to solve the error problem, in addition (shielding error function) can be changed php.ini to achieve this function? Solving!

------to solve the idea----------------------
The problem should be solved proactively, not avoid

Problems to be solved at the source, not after the remedial
All you have to do is make sure that $idcheck is an array (even an empty array).
------to solve the idea----------------------
Increase:
error_reporting (0); Turn off Error Reporting
?> try it.

Or
PHP.ini • All errors off display_errors = off; Give it a try.
  • 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.