colder Fri Jun 16 13:44:09 2006 UTC
Modified files:
/phpdoc/en/reference/pcre/functions preg-replace.xml
Log:
Fix #36112 (Bad example removed)
http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/pcre/functions/preg-replace.xml?r1=1.16&r2=1.17&diff_format=u
Index: phpdoc/en/reference/pcre/functions/preg-replace.xml
diff -u phpdoc/en/reference/pcre/functions/preg-replace.xml:1.16
phpdoc/en/reference/pcre/functions/preg-replace.xml:1.17
--- phpdoc/en/reference/pcre/functions/preg-replace.xml:1.16 Sun Mar 27
12:38:19 2005
+++ phpdoc/en/reference/pcre/functions/preg-replace.xml Fri Jun 16 13:44:09 2006
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.16 $ -->
+<!-- $Revision: 1.17 $ -->
<!-- splitted from ./en/functions/pcre.xml, last change in rev 1.2 -->
<refentry id="function.preg-replace">
<refnamediv>
@@ -174,50 +174,6 @@
&reftitle.examples;
<para>
<example>
- <title>Convert HTML to text</title>
- <programlisting role="php">
-<![CDATA[
-<?php
-// $document should contain an HTML document.
-// This will remove HTML tags, javascript sections
-// and white space. It will also convert some
-// common HTML entities to their text equivalent.
-$search = array ('@<script[^>]*?>.*?</script>@si', // Strip out javascript
- '@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags
- '@([\r\n])[\s]+@', // Strip out white space
- '@&(quot|#34);@i', // Replace HTML entities
- '@&(amp|#38);@i',
- '@&(lt|#60);@i',
- '@&(gt|#62);@i',
- '@&(nbsp|#160);@i',
- '@&(iexcl|#161);@i',
- '@&(cent|#162);@i',
- '@&(pound|#163);@i',
- '@&(copy|#169);@i',
- '@&#(\d+);@e'); // evaluate as php
-
-$replace = array ('',
- '',
- '\1',
- '"',
- '&',
- '<',
- '>',
- ' ',
- chr(161),
- chr(162),
- chr(163),
- chr(169),
- 'chr(\1)');
-
-$text = preg_replace($search, $replace, $document);
-?>
-]]>
- </programlisting>
- </example>
- </para>
- <para>
- <example>
<title>Using backreferences followed by numeric literals</title>
<programlisting role="php">
<![CDATA[