Funzione PHP die()
Esempio
Stampa un messaggio e termina lo script corrente:
<?php
$site = "https://www.w3schools.com/";
fopen($site,"r")
or die("Unable to connect to $site");
?>
Definizione e utilizzo
La funzione die() è un alias della funzione exit() .
Sintassi
die(message)
Valori dei parametri
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. |
Dettagli tecnici
Valore di ritorno: | Niente |
---|---|
Versione PHP: | 4+ |
❮ Riferimento a varie PHP