Hi, can I put a for loop in while loop? For example:
while($end = 1)
{
for ($i = 0; $i < count($match); $i++)
{
$mathcas = $match[$i][1];
}
}
Thanks. :)
Hi, can I put a for loop in while loop? For example:
while($end = 1)
{
for ($i = 0; $i < count($match); $i++)
{
$mathcas = $match[$i][1];
}
}
Thanks. :)
yes you can. though in the example you gave the outer while loop will either never end or never run
While it is perfectly possible, I strongly recommend avoiding the particular construct you are trying...
If you find the element you are lloking for, just break
the for
loop and you will be done!
Edit: and please use ==
for comparisons!!!