Thursday, April 20, 2017

Constants

<?php
echo "<Define constants:<br/>";
define('BLOG', "php cookbook");
echo BLOG . "<br/>";
if (!defined('ARTICLE_NAME')) {
 echo "Constant ARTICLE_NAME not defined, define now <br/>";
 define('ARTICLE_NAME', "php constants"); 
 echo "Constant ARTICLE_NAME defined <br/>";
}
Output:
Define constants:
php cookbook
Constant ARTICLE_NAME not defined, define now 
Constant ARTICLE_NAME defined 

No comments:

Post a Comment

here docs

$x = <<<THE_END PHP stands for "PHP: Hypertext Preprocessor". The acronym "PHP" is therefore, usually referre...