➤ The exit() function in PHP is an inbuilt function which is used to
output a message and terminate the current script.
• The exit() function returns nothing.
• The exit() function only terminates the execution of the script.
For instance:
$x = 10;
$y = 5;
exit; // Terminates the execution of the script
echo $x + $y; // This line will not be executed
$x = 10;
$y = 5;
exit("terminate the current script"); // Output a message
echo $x + $y; // This line will not be executed
by Levani Makhareishvili
2 years ago
PHP
Function
1
Pro tip: use ```triple backticks around text``` to write in code fences