How to stop execution of PHP script ?

Last updated 5 years ago | 4672 views 75     5

Tags:- PHP

PHP | Stop the execution of php script | exit() funtion

By using exit() function we can stop the execution of php script.

 
<?php

$a = 10;

$b = 20;

$c = $a+$b;

exit();

echo $c;

// In the above example execution will stop after addition it will not print variable c.

?>