Output a message and exit the current script:
<?php$site = "http://www.w3cschool.cc/";fopen($site,"r")or die("Unable to connect to $site");?>The die() function outputs a message and exits the current script.
This function is an alias for the exit() function.
die( message )
parameter | describe |
---|---|
message | Required. Specifies the message or status number to be written before exiting the script. Status numbers are not written to the output. |
Return value: | There is no return value. |
---|---|
PHP version: | 4+ |