PHP double-layer loop control, how to handle

Source: Internet
Author: User
PHP Double loop control
There are two loops, one is (Loop 1) 1,2,3....N, the other is (loop 2) a,b,c....z;
Now it's time to make a decision about whether each of the loops 1 is in loop 2, (if, find out) my own code is as follows:
for ($i =1; $i ++;i <>
if ($i =a) | | ($i =b) | | ($i =c) ($i =d) ...)
Echo ' Find ' $i;
}
Feel inefficient, welcome advice. Thank you very much.

------Solution--------------------
Commonjam (Commonjam)
' As of 2012-03-31 11:25:26 user knot rate 0%

When your question has been answered, please paste it in time.
Http://topic.csdn.net/u/20090501/15/7548d251-aec2-4975-a9bf-ca09a5551ba5.html
Http://topic.csdn.net/u/20100428/09/BC9E0908-F250-42A6-8765-B50A82FE186A.html
Http://topic.csdn.net/u/20100626/09/f35a4763-4b59-49c3-8061-d48fdbc29561.html

8, how to give points and knot paste?
http://community.csdn.net/Help/HelpCenter.htm# Knot Posts

------Solution--------------------
All the heroes in front of you said, not yet!
See below, hope to help you, read more manuals ah.
PHP Code
$arr 1 = Array (' F ', ' 1 ', ' 2 ', ' 3 ', ' C '); $arr 2 = Array (' A ', ' B ', ' C ', ' d ', ' e ', ' f ', ' G '); foreach ($arr 1 as $val) {    if (in_ Array ($val, $arr 2)) {        echo ' found '. $val. '
'; } else{ echo ' not found '. $val. '
'; }}
  • 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.