次のコードを見てみましょう。
if ($a == 1) {
echo "this is stage 1";
}
else if ($a == 2) {
echo "this is stage 2";
}
else if ($a == 3) {
$a = 1;
// at this point I want something that restarts the if-else construct so
// that the output will be "this is stage 1"
}
私は現在 if else コンストラクトに取り組んでおり、3 つのステージがあり、if-else コンストラクトが現在のステージをチェックするとしましょう。
ステージ 3 の一部のアクティビティがステージ 1 へのジャンプにつながる場合があります。これで、ステージ 1 のコードを既に渡しました。それを行う方法はありますか?さらに重要なことは、私が望むことを行うためのより良い方法はありますか? 私の考えは良い習慣とは思えないからです。