BBCode in PHP
Posted: Tue Aug 05, 2008 4:59 am
I am creating a comment system.
I have got the basic BBCode stuff down like bold, italics, underline and coloured.
But the thing I am having trouble with is the 'url' code.
The code for the 'url' tag is below...
When I tested it, it just seems to place my website address before the typed in address like so...
How could I fix this problem?
I have got the basic BBCode stuff down like bold, italics, underline and coloured.
But the thing I am having trouble with is the 'url' code.
The code for the 'url' tag is below...
Code: Select all
$Text = preg_replace ('/\[url\=(.*?)\](.*?)\[\/url\]/is', '<a href="$1">$2</a>', $Text);Code: Select all
http://www.mywebsite/typedinaddress