<?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