Really stuck on what seems to be something simple. I have a chatbox/shoutbox where there may be arbitrary URLs entered. I want to find each individual URL (separated by spaces) and wrap it in tags.
Example: Harry you're a http://google.com wizard! = Harry you're a $lhttp://google.com$l wizard!
Example: Harry you're a http://www.google.com wizard! = Harry you're a $lhttp://www.google.com$l wizard!
Example: Harry you're a www.google.com wizard! = Harry you're a $lwww.google.com$l wizard!
Sorry if this is a daft question; I’m just trying to make something work and I’m no php expert 🙁
There is an interesting article about a URL regular expression. In PHP this would look like:
And of course replace
[supertag]and[/supertag]with the appropriate values.