Hàm die() trong PHP
Ví dụ
In tin nhắn và chấm dứt tập lệnh hiện tại:
<?php
$site = "https://www.example.com.vn/";
fopen($site,"r")
or die("Unable to connect to $site");
?>
Định nghĩa và cách sử dụng
Hàm die() là 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ả về: | Không có gì |
---|---|
Phiên bản PHP: | 4+ |
❮ Tham khảo PHP linh tinh