我正在使用http://www.internoetics.com/2010/01/12/simple-whois-php-script/ PHP whois 脚本,我需要为最新的 PHP 版本配置它,我需要将 ereg 和 eregi 转换为 preg_match 和 preg_replace
if ( (!eregi('^[a-zA-Z0-9-]+\.([a-zA-Z]{2,4})$', $domain)) && (!eregi('^[a-zA-Z0-9-]+\.([a-zA-Z]{2,4})+\.([a-zA-Z]{2,4})$', $domain)) ) $arrErrors['domi'] = 'Domain name appears to be invalid.';
function makeClickableLinks($text)
{
$text = html_entity_decode($text);
$text = " ".$text;
$text = eregi_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:%_\+.~#?&//=]+)',
'<a href="\\1" target=_blank>\\1</a>', $text);
$text = eregi_replace('(((f|ht){1}tps://)[-a-zA-Z0-9@:%_\+.~#?&//=]+)',
'<a href="\\1" target=_blank>\\1</a>', $text);
$text = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_\+.~#?&//=]+)',
'\\1<a href="http://\\2" target=_blank>\\2</a>', $text);
$text = eregi_replace('([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})',
'<a href="mailto:\\1" target=_blank>\\1</a>', $text);
return $text;
}
谢谢