rustyofco Posted November 2, 2006 Share Posted November 2, 2006 1. how do I say "if this thing is equal to ANY OF THESE OTHER THINGS"And these other things are dynamic, and there can be a different quantity of these other things.2. Can you put a while funtion inside another while function? I tried it and it didn't seem to work... How can it work? Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted November 2, 2006 Share Posted November 2, 2006 1) Yes you can. The method for doing so depends on what these many other things are and how your program or database is storing them.2) You can do that also.[code]<?php$outer = 1;while($outer< 10){ $inner = 1; while($inner< 10){ echo "$inner * $outer = " . $inner++ * $outer . "<br/>"; } $outer++;?>[/code] Quote Link to comment Share on other sites More sharing options...
rustyofco Posted November 2, 2006 Author Share Posted November 2, 2006 1. I have an array, lets say 2,4,6,8 Next, I have a number x (just some random number between 1-10)Whenever x matches any of the elements of the array, I want it to echo MATCH (for example)BTW, the variable x changes because it is in a while loop. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted November 2, 2006 Share Posted November 2, 2006 Take a look at the function [url=http://www.php.net/in_array]in_array()[/url].Ken Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.