Mission of this functions is ended working programs. The biggest difference between die function and exit is you can show a message when a program ended by die function.
For Example:
<?php
if($a==10)
{
die("Program was ended");
} else
{
echo "program is continueing"
}
?>
In here, program will be ended because of $a=10 and it will bring string from function of die. If we want to make same example in exit :
<?php
$a=10;
if($a==10)
{
echo "Program was ended";
exit();
} else{
echo "Program is continueing." ;
}
?>
As you see, we have to write echo function. For this reason, we prefer die function. For example, if you have a problem in connection to database, you can show a warning message and you can stop the connection.
Showing posts with label server functions. Show all posts
Showing posts with label server functions. Show all posts
Monday, July 5, 2010
Function of PHP Exit and Die
Friday, July 2, 2010
Environmental Variables (SERVER FUNCTIONS)
CONTENT_LENGTH : It takes information about POST method from FORM.
DOCUMENT_ROOT : It keeps path.
HTTP_COOKIE : It is variable which keeps cookies .
HTTP_HOST : Host name or Host adress .
DOCUMENT_ROOT : It keeps path.
HTTP_COOKIE : It is variable which keeps cookies .
HTTP_HOST : Host name or Host adress .
Labels:
cookie,
echo,
Environmental,
get,
http,
magic php,
method,
PHP,
php function,
php tutorial,
post,
programing on php,
server functions,
webmaster
Subscribe to:
Posts (Atom)