Join Up!
104884 members and counting!

 
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links 
search for in the  
previousevalget_browsernext
Last updated: Tue, 28 May 2002
view the printer friendly version or the printer friendly version with notes or change language to Czech | German | Spanish

exit

(unknown)

exit -- Output a message and terminate the current script

Description

void exit ( [string status])

void exit ( int status)

Huomaa: This is not a real function, but a language construct.

The exit() function terminates execution of the script. It prints status just before exiting.

If status is an integer, that value will also be used as the exit status. Exit statuses should be in the range 1 to 254, the exit status 255 is reserved by PHP and shall not be used.

Huomaa: The current CVS version does NOT print the status if it is an integer.

Huomaa: The die() function is an alias for exit().

Esimerkki 1. exit() example

<?php

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

?>

User Contributed Notes
exit
add a note about notes
There are no user contributed notes for this page.
previousevalget_browsernext
Last updated: Tue, 28 May 2002
Copyright © 2001, 2002 The PHP Group
All rights reserved.
This mirror generously provided by: http://phpbuilder.com/
Last updated: Thu Oct 31 18:34:28 2002 EST