- Constant of any assigned value never be change in an execution of program.
- If assign value in a constant then the value of it never change means it stored value permanent.
- define( ) function is used for define a constant it has three parameter.
- parameter is Name of Constant,Value of Constant and Case-sensitive case-sensitive is optional for remove case-sensitive of constant name.
- For remove the case-sensitive of constant name we pass the true in third parameter.
define("Name of constant","Value of Constant");
Example
<?php define("Message","Hello php!"); echo "constant Message=".$Message; define("MSG","Hello world!"); echo "constant MSG".$MSG; ?>
Result
constant Message=Hello php! constant MSG=Hello world!
Example after remove case-sensitive from constant
<?php define("MSG","Hello world!",true); echo "constant MSG".$msg;//we can call constant MSG as lower form msg using third optional parameter ?>
Result
constant MSG=Hello world!//after pass the true in third parameter remove the case-sensitive on constant name
Hello, My Name is pradip parker . I am a Web Developer, Professional Blogger from India. i love and like web designing and developing, i have two year of experience in programming and developing I am the founder of programmingconcept. I started this blog in 2017 to for help developers by providing easy,small and best tutorials.
I simply want to tell you that I am all new to blogs and absolutely savored this web site. Most likely I’m likely to bookmark your blog . You surely have excellent writings. Thank you for sharing with us your web page.
stays on topic and states valid points. Thank you.
Some truly wonderful content on this web site , appreciate it for contribution.
Thanks for this site. I definitely agree with what you are saying.
Deference to op , some superb selective information .
very nice post, i actually love this web site, carry on it
Hey, bing lead me here, keep up nice work.
Very interesting points you have remarked, appreciate it for putting up.
Great, yahoo took me stright here. thanks btw for post. Cheers!
Great, yahoo took me stright here. thanks btw for info. Cheers!
You got yourself a new rader.
Thank You for this.