文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>php类常量定制及使用方法

php类常量定制及使用方法

时间:2011-02-23  来源:ljlxyf

<?php
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
*/

/**
 * Description of classConstSample
 *
 * @author liujl
 */
class classConstSample {
    const constVarTest="<a href='http://www.my400800.cn' title='400电话'>http://www.my400800.cn</a><br>";


    static public function  showMsgTest() {
        echo "利用内部方法输出常量值:".self::constVarTest;
    }

}

//常量调用输出测试
classConstSample::showMsgTest();
echo "直接输出常量值:".classConstSample::constVarTest;

?>

输出结果如下:

利用内部方法输出常量值:http://www.my400800.cn
直接输出常量值:http://www.my400800.cn

输出结果 截图如下:



相关阅读 更多 +
排行榜 更多 +
团队枪战中文版

团队枪战中文版

飞行射击 下载
团队枪战内置MOD菜单

团队枪战内置MOD菜单

飞行射击 下载
欢乐消除开心假日小游戏

欢乐消除开心假日小游戏

休闲益智 下载