Jump to content

simple loop problem


robert_gsfame

Recommended Posts

i have this simple code

 

<?php

$i=0;

$tot=0;

while($i==1){

$rand=rand(0,9);

while($mynumber=array(5,6)){

if(in_array($rand,$mynumber)){

$tot++;}

}

if($tot==0){

$i++;}else{}

}

echo $rand;

 

?>

 

how can $rand always come up with number other than 2 numbers in array.

This code give me blank result...which part is actually wrong

 

thx

 

Link to comment
https://forums.phpfreaks.com/topic/201864-simple-loop-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.