Do you have a question? Post it now! No Registration Necessary. Now with pictures!
April 10, 2006, 7:44 pm
rate this thread
I would like to use the ereg_replace() function to replace wiki-like
syntax, for example:
becomes <a href="index.php?page=somepage">somepage</a>
The problem with the first example is that "somepage" occurs twice
after the replacement, the problem with the second example is that the
opening and closing tags "**" are identical. Can anyone refer me to a
good page on ereg_replace(), or help me with these examples?
Re: ereg_replace() problems
$result = ereg_replace("\[\[([a-zA-Z0-9]+)\]\]", "<a
// will replace a string "[[somepage]]" with a string containing a URL
like you described above
$result = ereg_replace("\*\*([a-zA-Z0-9]+)\*\*", "<i></i>",