danbeck Thu Mar 8 11:47:24 2001 EDT
Modified files:
/phpdoc/en/functions misc.xml
Log:
added docs for the new constant function
Index: phpdoc/en/functions/misc.xml
diff -u phpdoc/en/functions/misc.xml:1.37 phpdoc/en/functions/misc.xml:1.38
--- phpdoc/en/functions/misc.xml:1.37 Thu Mar 8 09:57:13 2001
+++ phpdoc/en/functions/misc.xml Thu Mar 8 11:47:23 2001
@@ -75,6 +75,52 @@
</refsect1>
</refentry>
+ <refentry id="function.constant">
+ <refnamediv>
+ <refname>constant</refname>
+ <refpurpose>Returns the value of a constant</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>mixed <function>constant</function></funcdef>
+ <paramdef>string <parameter>name</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <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">
+<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>
+
+
<refentry id="function.define">
<refnamediv>
<refname>define</refname>
@@ -147,7 +193,8 @@
an error occurs.
</para>
<para>
- See also <function>defined</function> and the section on <link
+ See also <function>defined</function>,
+ <function>constant</function> and the section on <link
linkend="language.constants">Constants</link>.
</para>
</refsect1>
@@ -183,7 +230,8 @@
</example>
</para>
<para>
- See also <function>define</function> and the section on <link
+ See also <function>define</function>,
+ <function>constant</function> and the section on <link
linkend="language.constants">Constants</link>.
</para>
</refsect1>