这是我的 php 脚本:当我尝试将值返回到 $total 并随后回显函数 generate_random_3 时,在某些情况下它不会生成任何数字,请帮忙
<?php
function generate_random_3(){
for($x=0; $x<3; $x++){
$random[] = rand(1, 9);
}
list($first, $second, $third) = $random;
if($first!=$second AND $first!=$third AND $second!=$third AND $first!=0){
$total = $first.$second.$third;
return $total;
}else{
generate_random_3();
}
}
echo generate_random_3();
?>