PHP die()Functions
Examples
Output a message and exit the current script:
<?php
$site = "http://www.w3cschool.cc/";
fopen($site,"r")
or die("Unable to connect to $site");
?>
$site = "http://www.w3cschool.cc/";
fopen($site,"r")
or die("Unable to connect to $site");
?>
Definition and Usage
The die() function outputs a message and exits the current script.
This function isexit()an alias of the function.
Syntax
die(message)
| Parameters | Description |
|---|---|
| message | Required. Specifies the message or status number to write before exiting the script. The status number will not be written to the output. |
Technical Details
| Return Value: | No return value. |
|---|---|
| PHP Version: | 4+ |
PHP Misc Reference Manual Other Extensions