YouTip LogoYouTip

Func Misc Die

PHP die() Function |

-- Learning is not just about technology, but also about dreams!

PHP Tutorial

PHP Forms

PHP Advanced

PHP 7 New Features

PHP Database

PHP XML

PHP and AJAX

PHP Reference

PHP 5 Math Functions

PHP 5 MySQLi Functions

Explore Further

  • Dictionary and Encyclopedia
  • Data Management
  • Scripting Languages
  • Mathematics
  • Programming
  • Java (Programming Language)
  • Computer Science
  • Scripting
  • Web Design and Development
  • Data

PHP die() Function

PHP Misc Reference PHP Misc Reference

Example

Output a message and exit the current script:

<?php

$site = "http://www.w3cschool.cc/";

 fopen($site,"r")

 or die("Unable to connect to $site");

 ?>

Definition and Usage

The die() function outputs a message and exits the current script.

This function is an alias of the exit() function.


Syntax

die(message)

Parameter Description
message Required. Specifies the message or status number to write before exiting the script. The status number is not written to the output.

Technical Details

Return Value: No value is returned.
PHP Version: 4+

PHP Misc Reference PHP Misc Reference

← Func Misc EvalFunc Math Min β†’