How to stop execution of PHP script ?

Last updated 1 year, 9 months ago | 382 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.

?>