PHP die() Funkcja
Przykład
Wydrukuj wiadomość i zakończ bieżący skrypt:
<?php
$site = "https://www.w3schools.com/";
fopen($site,"r")
or die("Unable to connect to $site");
?>
Definicja i użycie
Funkcja die() jest aliasem funkcji exit() .
Składnia
die(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