Hello friends, this is my fifth tutorial of PHP and Today I am sharing the concept of using Constants in PHP. As we all know that constants are the values that remains fixed during the entire course of a program= and thus are really helpful for programmers for storing values that they can anywhere in the code. In PHP, using constant is very easy. Let us consider the example shown below :
 <?php 
$max_width=890;
define("MAX_WIDTH",890);
echo MAX_WIDTH;
?>
As you can see in the above code, I have used the define() method for creating a new constant named 'MAX_WIDTH'.

0 comments:

Post a Comment

Note: only a member of this blog may post a comment.