Home :: International :: Manuals :: Howto :: FAQ :: Man Pages :: Email Login

 
 

 

constant

(PHP 4 >= 4.0.4, PHP 5)

constant -- 定数の値を返す

説明

mixed constant ( string name)

constant() は、nameで指 定した定数の値を返します。

constant() はある定数の値を取得する必要がある が、その名前が不明な場合に有用です。これは、定数が変数に保存され ているか、関数により返されるかの場合です。

例 1. constant() の例

<?php

define
("MAXSIZE", 100);

echo
MAXSIZE;
echo
constant("MAXSIZE"); // 前の行と動作は同じ

?>

define(), defined(), constant() および 定数 の節を参照下さい。

 
 
 
 
Google
  Web Linuxinfor   
 

Home :: Copyright :: Privacy :: Credits :: Get a free Linuxinfor Email Account

Document on this page is part of "PHP マニュアル". See Index Page for more info about Authorship and Copyright.

1999-2009 Linuxinfor.com. No rights reserved.