PHP exit() Function

• The exit() function prints a message and exits the current script. 
• This function is an alias of the die() function. 

Syntax :-

exit(message)

• where message : Required. Specifies the message or status number to write before 
exiting the script. The status number will not be written to the output.

Example 

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

Post a Comment

If you have any doubts, Please let me know
Thanks!

Previous Post Next Post