我想使用PHP做while循環並找到一個隨機數。嘗試使用PHP'do-while'循環來查找隨機數
下面是代碼,它不工作...
<?php
$start = 10;
$end = 1;
$find = rand(0,9);
do {
if ($start == $find):
echo "Found!";
elseif ($start != $find):
echo $start;
$start = $start - $end;
endif;
} while ($start != $find);
?>
謝謝你的回答。猜我需要編輯我的問題... – flux