Caley
0
Q:

php exit

exit();		// Normal exit

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

exit('Error!');	// Exit and print an error message
2
<?php 
//declaring variables 
$a=5; 
$b=5.0; 
  
if($a==$b) 
 { 
    //terminating script with a message using exit() 
    exit('variables are equal'); 
 } 
else
 { 
   //terminating script with a message using exit() 
    exit('variables are not equal');  
 } 
?> 
1
//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)");

?>

0

New to Communities?

Join the community