Convert Plain Text Hyperlinks into HTML Hyperlinks in PHP
Posted
by Volomike
on Stack Overflow
See other posts from Stack Overflow
or by Volomike
Published on 2009-12-25T04:17:12Z
Indexed on
2010/05/16
7:30 UTC
Read the original article
Hit count: 617
I have a simple commenting system here...
http://affbuzz.com/comments/7299a55137def55917a5dc6c4fe0f261af8a4217
...and people can submit hyperlinks inside the plain text field. When I display these records back from the database and into the web page, what RegExp in PHP can I use to convert these links into HTML-type anchor links?
Bonus: For the algorithm to not do this with any other kind of link, just http and https.
© Stack Overflow or respective owner