note 53778 deleted from function.preg-replace by didou
| From: | didou@php.net | Date: | Mon, 13 Jun 2005 07:40:52 +0000 |
| Subject: | note 53778 deleted from function.preg-replace by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-90343@lists.php.net to get a copy of this message | ||
Note Submitter: shockzor
Reason: useless
----
Links to an article on Wikipedia using html/xhtml code.
<?php
$data = "My name is <WIKI:John_doe/>.";
echo preg_replace("%<WIKI:(\w+)\s*/?>%", "<a href=\"http://en.wikipedia.org/wiki/$1\">$1</a>",
$data);
?>
Links to an article on Wikipedia using BB code.
<?php
$data = "My name is [WIKI=John_doe].";
echo preg_replace("/\[WIKI=(\w+)\]/", "<a href=\"http://en.wikipedia.org/wiki/$1\">$1</a>",
$data);
?>