PHP入门1.3

来源:互联网 发布:python 运行效率 编辑:程序博客网 时间:2024/06/05 13:53
  1. 常量的定义
Example:<!DOCTYPE html><html>    <head>        <meta charset="utf-8"/>        <title>Hello Php</title>        </head>    <body>        <?php            /*            常量4种类型:int、float、String、bool                常量 define有三个参数                第三个参数决定常量是否严格区分大小写                                                    */            define("ENGINEERZHONG",520);            //定义一个常量名为 EngineerZhong 值为 520(int)            echo ENGINEERZHONG;            echo "<br>";            define("ENGINEERZHONG2",521,true);            echo engineerzhong2;            define("INT",100);//int 类型常量            define("STRING","Hello");//String 类型常量            define("FLOAT",5.20);//Float 类型常量            define("BOOL",'false');//Bool 类型常量,常量值使用 单引号            echo "<br>";            echo INT;            echo "<br>";            echo STRING;            echo "<br>";            echo FLOAT;            echo "<br>";            echo BOOL;        ?>    </body></html>

这里写图片描述

更新时间:2016年8月16日
0 0