mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-23 04:18:56 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@78496 c90b9560-bf6c-de11-be94-00142212c4b1
68 lines
1.8 KiB
XML
68 lines
1.8 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.2 $ -->
|
|
<!-- splitted from ./en/functions/misc.xml, last change in rev 1.38 -->
|
|
<refentry id="function.constant">
|
|
<refnamediv>
|
|
<refname>constant</refname>
|
|
<refpurpose>Returns the value of a constant</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>mixed</type><methodname>constant</methodname>
|
|
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<simpara>
|
|
<function>constant</function> will return the value of the
|
|
constant indicated by <parameter>name</parameter>.
|
|
</simpara>
|
|
<simpara>
|
|
<function>constant</function> is useful if you need to retrieve
|
|
the value of a constant, but do not know it's name. i.e. It is
|
|
stored in a variable or returned by a function.
|
|
</simpara>
|
|
<para>
|
|
<example>
|
|
<title><function>constant</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
define ("MAXSIZE", 100);
|
|
|
|
echo MAXSIZE;
|
|
echo constant("MAXSIZE"); // same thing as the previous line
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
See also <function>define</function>,
|
|
<function>defined</function> and the section on <link
|
|
linkend="language.constants">Constants</link>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|