answersLogoWhite

0


Best Answer

The function die() stops the script from running. See the example below:

<?php

die("this text will be outputted on the page");

echo "this text will not be shown due to the script ending when the die() function was called";

?>

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the function die used for in PHP?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How does PHP function in applications?

in php used for one typ website


What is header in php?

header() is a php function used to modify and set HTTP headers sent to the browser.


What is the getopt function in PHP?

It gets options from the command line argument list. It can be used in PHP 4.3 and above, including PHP 5.


How do you use settime out in php?

we cant use set timeout function in php because it is of java script function


How do you return a value in a PHP function?

Below is a simple example of how you could return a value in a PHP function. &lt;?php function returnme($value) { return $value; } echo returnme('hello'); // outputs: hello ?&gt;


What is the way to create a function in PHP?

function function_name() { .................... }


What are flags in php?

Flags in PHP are just a kind of constants. They map to a number and are used as optional function parameters. For instance in a file_put_contents() function there is a flag called FILE_APPEND, which appends the data to the file instead of overwriting it.


What is the delimiter used in PHP for scripting?

Please see this example as below. &lt;?php $first_variable = "Heloooo"; function first_method(){ print 'Heloooo'; } class firstClass{ public $testvar=""; function firstClass(){ // initialize $this-&gt;testvar = "Hiiiiiii"; } function first_method_inclass(){ print 'Heloooo'; } } ?&gt;


What is the function exit used for php?

In PHP, the exit() function calls and end to the script in much the same way as when the end of the script is reached naturally. Objects are destructed, garbage cleaned, and everything is wrapped up nicely and neatly. This is as opposed to die(), which just stops the script where it is without allowing other final processes to complete.


What does the php function eval?

The eval() function evaluates a string as PHP code. http://us.php.net/manual/en/function.eval.php


How do you use a function with a button in PHP?

A simple function call &lt;html&gt; &lt;body&gt; &lt;?php if(isset($_POST['button'])) { setValue(); // Function is called } function setValue() { echo "&lt;br&gt;The button property to call PHP function works"; // Your code here } ?&gt; &lt;input type="submit" name="button" onclick=&lt;?php $_SERVER['PHP_SELF']; ?&gt; /&gt; &lt;/body&gt; &lt;/head&gt;


What is a PHP function?

A PHP function is a block of reusable code that performs a specific task. Functions can accept input parameters and return a value, making them useful for organizing and simplifying code. They allow you to encapsulate logic and execute it whenever needed within a PHP program.