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'.
12 Dec 2014

0 comments:

Post a Comment

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

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.