PHP Find replace URL in text to HTML Links

Hi Guys, This is kinda straight forward thing to do using Regex magic so let go ahead and build our function which we will call plainUrlToLink() Here is that snippet that you can just copy paste. Don't forget to give this post a +1 if it helped you. The Snippet [crayon-61afb256b8d5e631695606/] As you notice that I am not doing a case insensitive replacing that's for a reason. That's that for our function but now lets check how to use it. [ltu] Usage To use this function is simple. It will return a plain text content if [crayon-61afb256b8d67732716927/] Above will print [crayon-61afb256b8d69454821640/] Please note that this function is good for finding links in plain text only and will not work if you pass HTML to it. Also if you want to include FTP URL detection then change you regex to this [crayon-61afb256b8d6a808187291/] I hope this helps. Every code has room for improvement, if you think this snippet can be improved please leave your feedback in comments, that will help other readers too. Cheers [/ltu] … [Read more...]