$s = join("",file("文件名"));
preg_match_all("/----- The following addresses had permanent fatal errors -----
<.+>
\(reason: .+\)/",$s,$regs);
print_r($regs);
preg_match_all("/----- The following addresses had permanent fatal errors -----
<.+>
\(reason: .+\)/",$s,$regs);
print_r($regs);
Array ( [0] => Array ( [0] => ----- The following addresses had permanent fatal errors ----- (reason: 553 5.3.5 system config error) [1] => ----- The following addresses had permanent fatal errors ----- (reason: 553 5.3.5 system config error) ) ) 只是把其中的这一段信息取到了。但并没有拿到中间的email信息。还请继续帮忙!
Array
(
[0] => Array
(
[0] => ----- The following addresses had permanent fatal errors -----
<[email protected]>
(reason: 553 5.3.5 system config error)
))
请用查看“源文件”,直接浏览器是看不到<[email protected]>的,因为浏览器把他当作标记了
不过还有一问。我如果再进一步。拿中间的email地址呢?
<.+>
改成
<(.+)>
结果在$regs[1]中