Source Code:
(back to article)
<?php $text = "Visit our website at http://www.example.com for more information."; $html = preg_replace("/http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w\- .\/?%&=]*)?/", "<a href='$0'>$0</a>", $text); echo $html; ?>
Result:
Report an issue