یه کامند goto داریم در PHP
<?php
goto a;
echo 'Foo';
a:
echo 'Bar';
?>
اطلاعات بیشتر:
https://www.php.net/manual/en/control-structures.goto.php
شاید پاسخ شما همینجا باشد
@khanzadimahdi
جای goto از چی استفاده کنم چطوری مثلا در این کد جای gotoچی بزارم
$first = \DB::table('users')->whereNull('id');
$users = \DB::table('users')->whereNull('id')->union($first)->get();
return $users;
$i=rand(1,100);;
while($i<200) {
$x2 = \App\DetailsModel::where('id', $i)->pluck('name_channel_en');
//return $x2;
if($x2->isEmpty()){
}else {
$x3 = \App\DetailsModel::where('name_channel_en', $x2)->get()->count();
if($x3<=1000){}else {
//echo "{$i}=".$x3."<br>";
//$ty[] = "{$i}=>" . $x3;
$ty[]=$i;
if(count($ty)==5){
goto F2;
}
}
}
$i++;
}
F2:
return $ty;@khanzadimahdi
یکبار دیگه چک میکنی