top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

What is the use of die in PHP?

0 votes
28 views
What is the use of die in PHP?
posted Dec 23, 2017 by Jdk

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

The die() function prints a message and exits the current script.The die() in PHP is equivalent to exit()

Syntax:

  die(message)

Example

<?php
$site = "https://www.queryhome.com/";
fopen($site,"r")
or die("Unable to connect to $site");
?>
answer Dec 26, 2017 by Madhavi Latha
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...