Constants In PHP : Samee Articles
Sample 1 : What is Constant in PHP?
Constant is a identifier for a simple value.The Value can not be changed during the script.
Value starts with letter or underscore, never with dollar sign "$".
It starts with "define."
Constant is default Case Sensitive.
Sample 2 : Constant Example in PHP
My Name is Samee Ullah Feroz.Sample 3 : Constant Example in PHP
My Nick Name is Sherri Bhai. <html>
<head>
<title>Constants in PHP : 6th Day Lecture : Samee</title>
<link rel="icon" type="image/ico" href="http://www.iconarchive.com/download/i50954/deleket/3d-cartoon-vol3/Web-Coding.ico" alt="Icon" />
<link type="text/css" href="http://www.getacho.com/download/phpcss/stylesheet.css" rel="stylesheet" />
<meta name="robots" value="nofollow, noindex" />
</head>
<body>
<img id="logo" src="http://icons.iconarchive.com/icons/deleket/3d-cartoon-vol3/256/Web-Coding-icon.png" alt="Coding">
<h1 align="center">Constants In PHP : <a href="http://sameearticles.blogspot.com" target="_blank">Samee Articles</a></h1>
<h2 align="left">Sample 1 : What is Constant in PHP?</h2>
<?php
echo 'Constant is a identifier for a simple value. <br /> The Value can not be changed during the script. <br /> Value starts with letter or underscore, never with dollar sign "$". <br /> It starts with "define." <br /> Contant is defauld Case Sansitive.';
?>
<h2 align="left">Sample 2 : Constant Example in PHP</h2>
<?php
define("name","My Name is Samee Ullah Feroz."); //here it is case sansitive.
echo name;
/*echo Name;*/ //Here is an error due to case sensitivity
?>
<h2 align="left">Sample 3 : Constant Example in PHP</h2>
<?php
define("name2","My Nick Name is Sherri Bhai.",true); //here it is not case sensitive.
echo Name2; //Here it is not sensitive due to "true" word
?>
</body>
</html>

Post a Comment
Give your reviews about this blog. Leave your comments. What do you think about this post?
Comments Guidelines:
1) I love to read comments, but please avoid spam.
2) Like this blog, share your insights, and spread the word.
3) You can use basic HTML/xHTML tags.
4) All comments are DoFollow—please use the section professionally.
5) Kindly mention your name or brand below your comment.
6) Constructive suggestions for improvement are always welcome.
Thanks for visiting Samee Articles.
========================================
Best Regards,
Samee U. Feroz