FREE Web Template Download
HTML CSS JAVASCRIPT SQL PHP BOOTSTRAP JQUERY ANGULARJS TUTORIALS REFERENCES EXAMPLES Blog
 

PHP exit() Function

PHP Misc Reference PHP Misc Reference

Example

Print a message and exit the current script:

<?php
$site = "http://tutorials/";
fopen($site,"r")
or exit("Unable to connect to $site");
?>


Definition and Usage

The exit() function prints a message and exits the current script.

This function is an alias of the die() function.


Syntax

exit(message)

Parameter 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 value is returned
PHP Version: 4+

PHP Misc Reference PHP Misc Reference