-3
가능한 중복 : 등 내가 ISP, 국가와 같은 많은 정보를 얻을이 코드로 이제
How to parse and process HTML with PHP?추출 웹 페이지 콘텐츠
<body>
<table align="center">
<?
$ip=$_SERVER['REMOTE_ADDR'];
$url=file_get_contents("http://whatismyipaddress.com/ip/$ip");
preg_match_all('/<th>(.*?)<\/th><td>(.*?)<\/td>/s',$url,$output,PREG_SET_ORDER);
for ($q=0; $q < 25; $q++) {
if ($output[$q][1]) {
if (!stripos($output[$q][2],"Blacklist")) {
echo "<tr><td>".$output[$q][1]."</td><td>".$output[$q][2]."</td></tr>";
}
}
}
?>
</table>
</body>
,
$ country, $ isp 등과 같이 데이터베이스에로드 할 수 있도록 콘텐츠를 추출하려면 어떻게해야합니까? 나는 그것이 XML로 변환되었지만 확신 할 수 없다면 완료 될 수 있다고 생각한다.
약간의 예제를 제공합니다 ... 샘플 코드 ... 이해할 수 없습니다. – user889030
많은 예제가 있습니다. 링크를 클릭하여 읽으십시오. 자세한 내용은 다음 문서를 참조하십시오. –
http://simplehtmldom.sourceforge.net/manual.htm –