Google

NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7">

exit

(PHP 3, PHP 4 )

exit -- メッセージを出力し、カレントのスクリプトを終了する

説明

void exit ( [string status])

注意 この関数は実際には関数ではなく言語構造です。

exit() 関数は、スクリプトの実行を終了します。 終了直前にstatusを出力します。

statusintegerの場合、その値 も終了ステータスとして使用されます。

注意 カレントのCVS版は、integerの場合、 statusを出力しません。

注意 関数die()は、exit()のエイ リアスです。

例 1exit()の例

<?php

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

?>