Help with While loops in PHP # 7


#1


$num_of_roll = 0; 
				do {
    			$roll = rand(1,6);
    			if ($roll == 6) {
        		echo"<p>We got 6!</p>";
            $num_of_roll++;
          }
    			else {
        		echo"<p>Too bad, let's try again</p>";
            $num_of_roll++;
            $roll = rand(1,6)
          }
        }
          while ($roll !=6); { 
          	$roll = rand(1,6); 
            $num_of_roll++; 
          };
          $verb="were";
          $last="rolls";
    
          echo "<p>There {$verb}{$num_of_roll}{$last}!</p>";


#2

What's your question?


#3

This code isn't working. what am i doing wrong here?


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.