PHP Miscellaneous Function
PHP Miscellaneous Function
Haresh Khachariya
(Lecturer)
Shree M & N Virani Science College ,
Rajkot
define()
define(name,value,case_insensitive)
<?php
define("GREETING","Hello you! How are you
today?");
echo constant("GREETING");
?>
<?php
define("GREETING","Hello you! How are you
today?",TRUE);
echo constant("greeting");
?>
constant()
The constant() function returns the value
of a
constant.
constant(constant)
<?php
define("GREETING","Hello you! How are you
today?");
echo constant("GREETING");
?>
include()
include 'filename';
<?php
include('myinclude.php');
echo This is include function;
?>
7
require
require
will
produce
a
fatal
error
(E_COMPILE_ERROR) and stop the script
files
(file_name);
<?php
require('myinclude.php');
header()
10
Syntax
header(string,replace,http_response_code)
Parameter
Description
string
replace
http_response_code
11
Example
header("Location: http://google.com");
header("Location: pages/page.php");
12
die()
The die() function prints
13
<?php
14
Questions?