From 2352fd53966b927ef16db891145351e8316a206a Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 13 Jul 2021 21:37:14 +0200 Subject: [PATCH] linkify tool um urls in text in echte links zu verwandeln --- string.php | 4 ++++ 1 file changed, 4 insertions(+) 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