The source of convert_link.php (click to demo the file) viewed 1881 times.
If I wrote this code, then it is licensed under the GPL. If someone else wrote it, then please ask them if you want to use the code.
<?php
$domain = "http://www.sebflipper.com";
$linked_domain =
eregi_replace('((f|ht)tps?://' . // protocol
'[0-9a-z]([-.]?[0-9a-z])*' . // domain
'\.[a-z]{2,3}/?' . // country-code
'(/+[-0-9a-z%_.~#?=&]+)*)', // path
'<a href="\1" target="_blank">\1</a>',
$domain);
echo "Before: $domain<br>After: $linked_domain";
?>
If you want to have a look at the source code, chose a file from this list:
To colour code your own PHP paste it here: