Hàm die () trong PHP
Thí dụ
In tin nhắn và kết thúc tập lệnh hiện tại:
<?php
$site = "https://www.w3schools.com/";
fopen($site,"r")
or die("Unable to connect to $site");
?>
Định nghĩa và Cách sử dụng
Hàm die () là một bí danh của hàm exit () .
Cú pháp
die(message)
Giá trị tham số
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. |
Chi tiết kỹ thuật
Giá trị trả lại: | Không |
---|---|
Phiên bản PHP: | 4+ |
❮ Tham chiếu khác PHP