Posted by Markus Schφllnast on 04/11/06 17:27
pieterprovoost@gmail.com schrieb:
> [[somepage]]
> becomes <a href="index.php?page=somepage">somepage</a>
>
> **hello**
> becomes <i>hello</i>
Hi,
try
$result = ereg_replace("\[\[([a-zA-Z0-9]+)\]\]", "<a
href=\"index.php?page=\\1\">\\1</a>", $yourString);
// will replace a string "[[somepage]]" with a string containing a URL
like you described above
$result = ereg_replace("\*\*([a-zA-Z0-9]+)\*\*", "<i>\\1</i>",
$yourString);
Markus
[Back to original message]
|