PHP exit() Funkcja
Przykład
Wydrukuj wiadomość i zamknij bieżący skrypt:
<?php
$site = "https://www.w3schools.com/";
fopen($site,"r")
or exit("Unable to connect to $site");
?>
Definicja i użycie
Funkcja exit() drukuje komunikat i kończy bieżący skrypt.
Składnia
exit(message)
Wartości parametrów
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. |
Szczegóły techniczne
Wartość zwrotu: | Nic |
---|---|
Wersja PHP: | 4+ |
❮ PHP Różne odniesienia