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. '
'; }}