3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'Hi bro! Look at my new website: www.example.com. I leard to build websites from http://another.example.net and from example.net.'; $newStr = preg_replace('!(http|ftp|scp)(s)?:\/\/[a-zA-Z0-9.?&_/]+!', "<a href=\"\\0\">\\0</a>",$str); echo $newStr;

preferences:
48.51 ms | 402 KiB | 5 Q