-dt-
Scripting Contest Winner
;o
Posts: 1819 Reputation: 74
36 / /
Joined: Mar 2004
|
RE: PHP help
code:
$string = preg_replace('/\[\[wiki(?:\:|)([a-zA-Z]+|)\]([a-zA-z0-9]+)\]/e', 'defL("$1","$2")',$string);
function defL($lang,$title){
if($lang=='')$lang='en';
return "<a href='http://$lang.wikipedia.org/wiki/$title'>$title</a>";
}
that works fine
This post was edited on 10-01-2005 at 09:32 AM by -dt-.
Happy Birthday, WDZ
|
|