Output a message and exit the current script:
<?php$site = "http://www.w3cschool.cc/";fopen($site,"r")or exit("Unable to connect to $site");?>The exit() function outputs a message and exits the current script.
This function is an alias for the die() function.
exit( 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+ |