書き方は次の2つ
【書き方1】
while(式) {
文;
}
【書き方2〜whileの行末が : であることに注意!!】
while(式):
文;
endwhile;
【書き方2は要するに次のような意味だ】
while(式):文;
endwhile;
0123456789
0123456789
source
<?php
$a = 0;
while($a < 10) {
echo $a++;
}
echo "<p>";
$b = 0;
while($b < 10):
echo $b++;
endwhile;
echo "<p>";
$c = 0;
while($c < 10):echo $c++;
endwhile;
?>