Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: Regex Problem....
03-20-2007, 01:26 AM #1
- Join Date
- Feb 2007
- Thanked 0 Times in 0 Posts
I am struggling a lot with coding something currently. I am basically trying to do a very very very simple wiki style of internal linking on my site. I have gotten it so that with ereg_replace I can convert [[test]] to <a href='http://www.mysite.com/page?id=test'>test</a>, the problem is that I need to make it so that if the id is Joe Bloggs that it makes the id value in the link Joe_Bloggs.
$output = ereg_replace("\\[\\[([^\*)\\]\\]","<a href=\"http://www.mysite.com/dir/\\1\">\\1</a>",$input);