Let's say that I want to create a html tag from the url parsed to script from a textarea. The url could point on www page -> like http://www.wp.pl , attachement -> http://www.somesite.com/attachment.zip or img -> http://www.somesite.com/picture.jpg. Depending on what url points on the function should return typical '<a href' or '<img src' stuff. I wrote the function and it's doing great so there's no problem with that.
The problem is how to parse the url to that function from ereg_replace()
I've tried the following:
Code: Select all
$html_tag = ereg_replace("[[]]+://[^<>[]]+[[]/]",
create_tag_from_url("\\0"), $textarea_content);I would be very gratefull.