diff --git a/string.php b/string.php index b96111c..33ef3d1 100644 --- a/string.php +++ b/string.php @@ -257,4 +257,8 @@ function onlySimpleHTML($s) { return $s; } +function linkify($input) { + $pattern = '@(http(s)?://)?(([a-zA-Z])([-\w]+\.)+([^\s\.]+[^\s]*)+[^,.\s])@'; + return $output = preg_replace ( $pattern, '$0', $input ); +} ?> \ No newline at end of file