CVS update: phpdoc/functions

From: Date: Mon, 21 Jun 1999 22:12:43 +0000
Subject: CVS update: phpdoc/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-7350@lists.php.net to get a copy of this message
Date: Monday June 21, 1999 @ 18:12 Author: jim Update of /repository/phpdoc/functions In directory php:/tmp/cvs-serv23199/functions Modified Files: regex.sgml Log Message: Add clarifications about return value of ereg_replace. Index: phpdoc/functions/regex.sgml diff -u phpdoc/functions/regex.sgml:1.2 phpdoc/functions/regex.sgml:1.3 --- phpdoc/functions/regex.sgml:1.2 Sat Jun 19 21:21:16 1999 +++ phpdoc/functions/regex.sgml Mon Jun 21 18:12:43 1999 @@ -58,13 +58,13 @@ /* Places three space separated words into $regs[1], $regs[2] and $regs[3]. */ -ereg_replace("^","&lt;BR&gt;",$string); +$string = ereg_replace("^","&lt;BR&gt;",$string); /* Put a &lt;BR&gt; tag at the beginning of $string. */ -ereg_replace("$","&lt;BR&gt;",$string); +$string = ereg_replace("$","&lt;BR&gt;",$string); /* Put a &lt;BR&gt; tag at the end of $string. */ -ereg_replace("\n","",$string); +$string = ereg_replace("\n","",$string); /* Get rid of any carriage return characters in $string. */ </programlisting> @@ -145,6 +145,11 @@ with <parameter>replacement</parameter>. <para> + The modified string is returned. (Which may mean that the + original string is returned if there are no matches to be + replaced.) + + <para> If <parameter>pattern</parameter> contains parenthesized substrings, <parameter>replacement</parameter> may contain substrings of the form @@ -155,12 +160,12 @@ Parentheses may be nested, in which case they are counted by the opening parenthesis. - <para> - If no matches are found in <parameter>string</parameter>, then - <parameter>string</parameter> will be returned unchanged. + <para> + If no matches are found in <parameter>string</parameter>, then + <parameter>string</parameter> will be returned unchanged. - <para> - For example, the following code snippet + <para> + For example, the following code snippet prints "This was a test" three times: <example> <title>ereg_replace() example</title> @@ -169,10 +174,12 @@ echo ereg_replace( " is", " was", $string ); echo ereg_replace( "( )is", "\\1was", $string ); echo ereg_replace( "(( )is)", "\\2was", $string ); -</programlisting></example> - - See also <function>ereg</function>, <function>eregi</function>, and <function>eregi_replace</function>. + </programlisting> + </example> + <para> + See also <function>ereg</function>, <function>eregi</function>, + and <function>eregi_replace</function>. </refsect1> </refentry>

« previous php.dev (#7350) next »