note 48194 added to function.preg-replace
| From: | jeremy at arrowtech dot net | Date: | Wed, 15 Dec 2004 04:06:27 +0000 |
| Subject: | note 48194 added to function.preg-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-81806@lists.php.net to get a copy of this message | ||
The following code with assign $output the value of $input where text found between the <code
/> tags has been replaced with the syntax-highlighted version thereof.
$output = preg_replace("/<code>(.*?)<\/code>/ies",
"highlight_string(stripslashes('\\1'), TRUE)", $input);
----
Manual Page -- http://www.php.net/manual/en/function.preg-replace.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+48194
Delete -- http://master.php.net/manage/user-notes.php?action=delete+48194&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48194&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48194&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48194&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48194&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48194&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+48194&report=yes
Search -- http://master.php.net/manage/user-notes.php