П О Р Т А Л                            
С Е Т Е В Ы Х                          
П Р О Е К Т О В                        
  
                                                 
Главная

О проекте

Web-мастеру
     HTML & JavaScript
     SSI
     Perl
     PHP
     XML & XSLT
     Unix Shell

MySQL

Безопасность

Хостинг

Другое







Самое читаемое:

Учебник PHP - "Для Чайника".
Просмотров 91825 раз(а).

Иллюстрированный самоучитель по созданию сайтов.
Просмотров 28164 раз(а).

Учебник HTML.
Просмотров 54683 раз(а).

Руководство по PHP5.
Просмотров 25077 раз(а).

Хостинг через призму DNS.
Просмотров 29344 раз(а).

Подборка текстов стандартных документов.
Просмотров 28112 раз(а).

Учебник PHP - Самоучитель
Просмотров 32392 раз(а).

Документация на MySQL (учебник & справочное руководство)
Просмотров 34104 раз(а).

Внешние атаки...
Просмотров 26105 раз(а).

Учебник PHP.
Просмотров 22006 раз(а).

SSI в примерах.
Просмотров 17307 раз(а).



 
 



Руководство по PHP
Пред. След.

exit

(PHP 3, PHP 4, PHP 5)

exit -- Output a message and terminate the current script

Description

void exit ( [string status] )

void exit ( int status )

Замечание: This is not a real function, but a language construct.

Замечание: PHP >= 4.2.0 does NOT print the status if it is an integer.

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 0 to 254, the exit status 255 is reserved by PHP and shall not be used. The status 0 is used to terminate the program successfully.

Пример 1. exit() example

<?php

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

?>

Пример 2. exit() status example

<?php

//exit program normally
exit;
exit();
exit(
0);

//exit with an error code
exit(1);
exit(
0376); //octal

?>

Замечание: The die() function is an alias for exit().

See also: register_shutdown_function().



 





Copyright © 2005-2011 Project.Net.Ru