PHP exit() Functie
Voorbeeld
Druk een bericht af en sluit het huidige script af:
<?php
$site = "https://www.w3schools.com/";
fopen($site,"r")
or exit("Unable to connect to $site");
?>
Definitie en gebruik
De functie exit() drukt een bericht af en beëindigt het huidige script.
Syntaxis
exit(message)
Parameterwaarden
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. |
Technische details
Winstwaarde: | Niets |
---|---|
PHP-versie: | 4+ |
❮ PHP overige referentie