Answers for "exit in php"

PHP
5

php quit

exit();		// Normal exit

exit(1);	// Exit with an error code

exit('Error!');	// Exit and print an error message
Posted by: Guest on June-01-2020
2

exit and echo php

//exit — Output a message and terminate the current script
<?php

$filename = '/path/to/data-file';
$file = fopen($filename, 'r')
    or exit("unable to open file ($filename)");

?>
Posted by: Guest on December-01-2020

Browse Popular Code Answers by Language