PHP Constants are variables whose values cannot be changed. There are constants that are defined already in PHP but you can also define your own constants.

User Defined Constants

You can define your own constants using PHP define() function.

Syntax: define('constant-name', 'constant-value', 'case-sensitive(optional)');

Unlike global variables, constant name should not start with $
Ideally, constants are written as uppercase to make it recognizable by others as a constant.

Example


<?php
define("SITE_URL", "http://yourwebtech.info"); 

echo 'This website url is' . SITE_URL;
?>

Magic Constants

PHP has pre-defined constants which is called Magic Constants.

Constant Description PHP Version
__LINE__ Return the current line number of the file. 4 or Higher
__FILE__ Return the full path and filename of the file. If used inside an include, the name of the included file is returned. 4.0.2 or Higher
__DIR__ Return the directory of the file. If used inside an include, the directory of the included file is returned. This is equivalent to dirname(__FILE__). 5.3.0 or Higher
__FUNCTION__ As of PHP 5 this constant returns the function name as it was declared (case-sensitive). In PHP 4 its value is always lowercased. 4.3 or Higher
__CLASS__ As of PHP 5 this constant returns the class name as it was declared (case-sensitive). In PHP 4 its value is always lowercased. The class name includes the namespace it was declared in (e.g. Foo\Bar). 4.3 or Higher
__TRAIT__ As of PHP 5.4 this constant returns the trait as it was declared (case-sensitive). The trait name includes the namespace it was declared in (e.g. Foo\Bar). 5.4 or Higher
__METHOD__ Return the method name is returned as it was declared (case-sensitive). 5.0 or Higher
__NAMESPACE__ The name of the current namespace (case-sensitive). This constant is defined in compile-time. 5.3 or Higher

How to take Cialis it seems to me that would already be time to cease to discuss this question. As I already answered it not once. Have it in a look. You shouldn’t worry! All deer go south when they are called by homesickness. Are turned and lie on snow till some hours.