这是我正在处理的代码:
foreach($domainextensions as $extension => $who) {
$buffer = NULL;
if ($sock = fsockopen($who[0], 43) or die('sock' . $sock));
fputs($sock, $domain.$extension . "\r\n");
while( !feof($sock) ) {
$buffer .= fgets($sock,128);
}
fclose($sock);
if(preg_match($who[1],$buffer)) {
echo '';
}
错误是:
Warning: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash in somewhere.php
if(preg_match($who[1],$buffer)){}
原始函数是eregi,eregi运行正常,但eregi已被取消:
if(eregi($who[1],$buffer)){}
如何在preg_match
定义上更改定义的分隔符?
答案 0 :(得分:0)
foreach($domainextensions as $extension => $who) {
$buffer = NULL;
if ($sock = fsockopen($who[0], 43)
/
or die('sock' . $sock));
fputs($sock, $domain.$extension . "\r\n");
while( !feof($sock) )
{
$buffer .= fgets($sock,128);
}
fclose($sock);
if(preg_match('/'.$who[1].'/i',$buffer))
{
echo '';
}
应该对模式进行分隔