[PHP Activity][6.11] คำสั่ง break


กิจกรรม 6.11 คำสั่ง break

Code


<?php
// ลูปที่ 1 
echo "เริ่มลูปที่ 1<br>"; 
$test ="A"; 
while ($test<"Z"){ 
echo "[" . $test . "]"; 
if ($test == "L"){ 
echo "<br>"; 
break; 
} 
$test++; 
} 
echo "เริ่มลูปที่ 2 <br>"; 
//ลูปที่ 2 
for ($num=10;$num>=0;$num-=2){ 
echo "[" . $num . "]"; 
} 
?>

ความคิดเห็น

โพสต์ยอดนิยมจากบล็อกนี้

ใช้ Word ให้เรียกข้อมูลจาก Excel ในแต่ละแถวมาแสดง import data from excel to show in word

การ Comment ในภาษา PHP

แท็ก PHP การเปิดปิดแท็ก