constant
返回常量的值
constant()
函數返回常量的值。
注意:這個函數也可以用於類常量。
返回常量的值:
<?php // 定義一個常量 define ( "GREETING" , "Hello you! How are you today?" ) ; // 使用constant() 函數獲取常量的值並輸出 echo constant ( "GREETING" ) ; ?>
親自試一試
constant ( constant )
參數 | 描述 |
---|---|
constant | 必需。規定要檢查的常量的名稱。 |