/ Published in: PHP
![](/img/icon_sav.png?v3)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// $subject contains a body of text with non html URLs $text = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\">\\0</a>", $subject);
URL: http://www.adampatterson.ca/blog/2011/02/regular-expression-for-url-using-ereg_replace/
Comments
![RSS Feed for Comments RSS Icon](/images/rss.png?v3)