PHP die() 함수
예시
메시지를 인쇄하고 현재 스크립트를 종료합니다.
<?php
$site = "https://www.w3schools.com/";
fopen($site,"r")
or die("Unable to connect to $site");
?>
정의 및 사용
die() 함수는 exit() 함수의 별칭입니다.
통사론
die(message)
매개변수 값
Parameter | Description |
---|---|
message | Required. A message or status number to print before terminating the script. A status number will not be written to the output, just used as the exit status. |
기술적 세부 사항
반환 값: | 아무것도 |
---|---|
PHP 버전: | 4+ |
❮ PHP 기타 참조