I am trying to convert, from a textarea input ($_POST[\'content\']), all urls to link.
$content = preg_replace(\'!(\\s|^)((https?://)+[a-z0-9_./
This has been done hundreds of times over before. On this page either m-buettner and glavić work fine although I like glivic's shorter expression.
Here's a good php resource to do it: http://code.iamcal.com/php/lib_autolink/
Repeats on Stackoverflow:
Decent in-depth article: - http://buildinternet.com/2010/05/how-to-automatically-linkify-text-with-php-regular-expressions/