首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > PHP >

php基础-define跟defined函数的使用

2012-10-07 
php基础-define和defined函数的使用??? define(TEST_ATTR,hhhhhhh)??? echo TEST_ATTR?define相当于

php基础-define和defined函数的使用

??? define("TEST_ATTR","hhhhhhh");
??? echo TEST_ATTR;

?

define相当于java中的constant用来定义一个常量;

?

defined() 函数检查某常量是否存在。

若常量存在,则返回 true,否则返回 false。

?

define("GREETING","Hello world!");echo defined("GREETING");

热点排行