Date: 09/26/98
- Next message: Bug Database: "[PHP-DEV] Bug #790 Updated: Apache web-Server won't work"
- Previous message: hrauch <email protected>: "[PHP-DEV] Bug #790: Apache web-Server won't work"
- Next in thread: ssb: "[PHP-DEV] CVS update: php3/doc/functions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Saturday September 26, 1998 @ 5:36
Author: cslawi
Update of /repository/php3/doc/functions
In directory asf:/u2/tmp/cvs-serv14384
Modified Files:
misc.sgml
Log Message:
Added eval().
Index: php3/doc/functions/misc.sgml
diff -c php3/doc/functions/misc.sgml:1.5 php3/doc/functions/misc.sgml:1.6
*** php3/doc/functions/misc.sgml:1.5 Mon Sep 7 07:47:36 1998
--- php3/doc/functions/misc.sgml Sat Sep 26 05:36:43 1998
***************
*** 8,13 ****
--- 8,70 ----
categories seemed to fit.
</partintro>
+ <refentry id="function.eval">
+ <refnamediv>
+ <refname>eval</refname>
+ <refpurpose>Evaluate a string as PHP code</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcdef>void <function>eval</function></funcdef>
+ <paramdef>string <parameter>code_str</parameter></paramdef>
+ </funcsynopsis>
+
+ <simpara>
+ <function>eval</function> evaluates the string given in
+ <parameter>code_str</parameter> as PHP code. Among other things,
+ this can be useful for storing code in a database text field for
+ later execution.
+
+ <simpara>
+ There are some factors to keep in mind when using
+ <function>eval</function>. Remember that the string passed must
+ be valid PHP code, including things like terminating statements
+ with a semicolon so the parser doesn't die on the line after the
+ <function>eval</function>, and properly escaping things in
+ <parameter>code_str</parameter>.
+
+ <simpara>
+ Also remember that variables given values under
+ <function>eval</function> will retain these values in the main
+ script afterwards.
+
+ <para>
+ <example>
+ <title>eval() example - simple text merge</title>
+ <programlisting>
+ <?php
+ $string = 'cup';
+ $name = 'coffee';
+ $str = 'This is a $string with my $name in it.<br>';
+ echo $str;
+ eval( "\$str = \"$str\";" );
+ echo $str;
+ ?>
+ </programlisting>
+ </example>
+
+ <para>
+ The above example will show:
+ <programlisting>
+ This is a $string with my $name in it.
+ This is a cup with my coffee in it.
+ </programlisting>
+
+ </refsect1>
+ </refentry>
+
+
<refentry id="function.leak">
<refnamediv>
<refname>leak</refname>
-- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe <email protected> For help: php-dev-help <email protected>
- Next message: Bug Database: "[PHP-DEV] Bug #790 Updated: Apache web-Server won't work"
- Previous message: hrauch <email protected>: "[PHP-DEV] Bug #790: Apache web-Server won't work"
- Next in thread: ssb: "[PHP-DEV] CVS update: php3/doc/functions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

