3v4l.org

run code in 500+ PHP versions simultaneously
<?php function liveLinks($text){ $trans = array("(" => "", ")" => ""); $reg_exUrl = '@(http(s)?://)?(([a-zA-Z])([-\w]+\.)+([^\s.]+\S*)+[^,.\s]+[^$()]+)@'; return preg_replace_callback($reg_exUrl, function($m) use ($trans) { return '<a href="http' . $m[2]. '://' . strtr($m[3], $trans) . '">' . strtr($m[0], $trans) . '</a>'; }, $text); } echo liveLinks('https://nimbusweb.me/s/share/3130667/59rpygxll4mm4ul5so()t');
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.32, 8.3.0 - 8.3.33, 8.4.1 - 8.4.24, 8.5.0 - 8.5.9
<a href="https://nimbusweb.me/s/share/3130667/59rpygxll4mm4ul5sot">https://nimbusweb.me/s/share/3130667/59rpygxll4mm4ul5sot</a>

preferences:
115.79 ms | 1551 KiB | 4 Q