Blogger Information
Blog 16
fans 0
comment 2
visits 16304
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
第三天第二课主要学常量
长沙php专家
Original
680 people have browsed it

//第二课 主要讲的是常量


//首先 常量需要定义  然后检测  然后输出


//定义关键字有两个  define 和 const

//检测有constant 和 GET_DEFINED_CONSTANTS


define ('MYTEACHER','朱老师');

const HISTEACHER='朱老师';


//定义好了之后检测


echo constant ('MYTEACHER') ? 2 : 3;   


//输出 

echo MYTEACHER,HISTEACHER;

echo '<hr color="gray";>';

echo defined('MYTEACHER') ? true : false;

echo '<pre>';

print_r (GET_DEFINED_CONSTANTS()); // 这个浏览器里输出了很多常量,我都没定义过,不知道哪里跑出来的。


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post