<分区>
Possible Duplicate:
replace ereg_replace with preg_replace
我在代码库中获得了以下函数,该函数采用字符串并使链接处于事件状态。我注意到 ereg_replace() 已折旧。我将如何更改它以使用 preg_replace?
function makeActiveLink($originalString){
$newString = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a href=\"\\0\" target=\"_blank\">\\0</a>", $originalString);
return $newString;
}