PHP exit() Funzione
Esempio
Stampa un messaggio ed esci dallo script corrente:
<?php
$site = "https://www.w3schools.com/";
fopen($site,"r")
or exit("Unable to connect to $site");
?>
Definizione e utilizzo
La funzione exit() stampa un messaggio e termina lo script corrente.
Sintassi
exit(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