Funkce PHP die() .
Příklad
Vytiskněte zprávu a ukončete aktuální skript:
<?php
$site = "https://www.w3schools.com/";
fopen($site,"r")
or die("Unable to connect to $site");
?>
Definice a použití
Funkce die() je aliasem funkce exit() .
Syntax
die(message)
Hodnoty parametrů
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. |
Technické údaje
Návratová hodnota: | Nic |
---|---|
Verze PHP: | 4+ |
❮ PHP Různé Reference