Php double-layer loop control has two loops, one being (Loop 1) 1, 2, 3 .... n, the other is (loop 2) a, B, c .... z; now you need to make a judgment to determine whether each item of Loop 1 is in loop 2 (if found). my own code is as follows: for ($ i1; $ I ++; I & lt; N) {if ($ ia) | ($ ib) | ($ ic) ($ id ).....) echo found $ I;} feeling low efficiency php double-layer loop control
There are two loops, one being (Loop 1) 1, 2, 3... N, and the other being (loop 2) a, B, c... z;
Now we need to make a judgment to determine whether each item of Loop 1 is in loop 2 (if found). my own code is as follows:
For ($ I = 1; $ I ++; I If ($ I = a) | ($ I = B) | ($ I = c) ($ I = d ).....)
Echo 'found' $ I;
}
I feel inefficient. thank you for your advice. Thank you very much.
------ Solution --------------------
Commonjam (commonjam)
'User posting rate as of 11:25:26 is 0.00%
Post your questions as soon as they are answered.
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 do I add and divide messages?
Http://community.csdn.net/help/helpcenter.htm#
------ Solution --------------------
I have already told you that it's not done yet!
For more information, see the manual ..
PHP code
$ Arr1 = array ('F', '1', '2', '3', 'C'); $ arr2 = array ('A', 'B ', 'C', 'D', 'e', 'F', 'g'); foreach ($ arr1 as $ val) {if (in_array ($ val, $ arr2) {echo 'found '. $ val.'
';} Else {echo' not found '. $ val .'
';}}