3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $message = "Lorem ipsum dolor sit amet, consectetur http://www.adipiscing.nl elit. Etiam sit amet http://www.odio.com leo. Mauris vitae sem sed diam ultricies egestas semper a risus. Mauris sem tortor, hendrerit eget aliquet ac, lacinia in tortor. http://www.Aenean.co.uk mauris nibh, luctus sit amet ipsum aliquet, vestibulum aliquam sem. Cras non felis sodales, pretium augue non, porttitor tortor."; $message = preg_replace('@(https?://([-\w.]+[-\w])+(:\d+)?(/([\w-.~:/?#\[\]\@!$&\'()*+,;=%]*)?)?)@', '<a href="$1" target="_blank">$1</a>', $message);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0