fff.html 是一封包含电子邮件地址的电子邮件,有些有 href mailto 链接,有些没有,我想抓取它们并将它们输出为以下格式
Lorem@ipsum.com,dolor@sit.com,amet@consectetur.com
我有一个简单的刮刀来获取那些链接href但有些奇怪的东西
<?php
$url = "fff.html";
$raw = file_get_contents($url);
$newlines = array("\t","\n","\r","\x20\x20","\0","\x0B");
$content = str_replace($newlines, "", html_entity_decode($raw));
$start = strpos($content,'<a href="mailto:');
$end = strpos($content,'"',$start) + 8;
$mail = substr($content,$start,$end-$start);
print "$mail<br />";
?>
我应该为最初使用 lorem ipsum 加分