PHP ตาย ()ฟังก์ชั่น
ตัวอย่าง
พิมพ์ข้อความและยุติสคริปต์ปัจจุบัน:
<?php
$site = "https://www.w3schools.com/";
fopen($site,"r")
or die("Unable to connect to $site");
?>
ความหมายและการใช้งาน
ฟังก์ชัน die() เป็นนามแฝงของฟังก์ชันexit()
ไวยากรณ์
die(message)
ค่าพารามิเตอร์
Parameter | Description |
---|---|
message | Required. A message or status number to print before terminating the script. A status number will not be written to the output, just used as the exit status. |
รายละเอียดทางเทคนิค
คืนมูลค่า: | ไม่มีอะไร |
---|---|
รุ่น PHP: | 4+ |
❮ PHP การอ้างอิงเบ็ดเตล็ด