<?php
$text = 'asdasd http://www.dr.dk asdasd http://www.doo.dk';
$text = preg_replace('^(([\\w]+:)?//)?(([\\d\\w]|%[a-fA-f\\d]{2,2})+(:([\\d\\w]|%[a-fA-f\\d]{2,2})+)?@)?([\\d\\w][-\\d\\w]{0,253}[\\d\\w]\\.)+[\\w]{2,4}(:[\\d]+)?(/([-+_~.\\d\\w]|%[a-fA-f\\d]{2,2})*)*(\\?(&?([-+_~.\\d\\w]|%[a-fA-f\\d]{2,2})=?)*)?(#([-+_~.\\d\\w]|%[a-fA-f\\d]{2,2})*)?^','<a href="$0">$0</a>',$text);
print $text;
?>
Indlæg senest redigeret d. 23.05.2007 10:40 af Bruger #10216