PHP enddeclareคำสำคัญ
ตัวอย่าง
ปิดบล็อกประกาศ:
<?php
$count = 0;
function example() {
global $count;
$count++;
echo "$count instructions executed<br>";
}
register_tick_function('example');
declare(ticks=1):
$cars =
["Ford", "Volvo", "BMW"];
foreach($cars as $car) {
echo "$car <br>";
}
enddeclare;
?>
ความหมายและการใช้งาน
enddeclare
คีย์เวิร์ดใช้เพื่อปิด บล็อก ที่declare
เริ่มใช้
declare(...):
ไวยากรณ์
หน้าที่เกี่ยวข้อง
ประกาศคีย์เวิร์ด_
❮ คีย์เวิร์ด PHP