웹 사이트의 웹 페이지 (예 : example.com)에서 시작하여 동일한 도메인에있는이 페이지의 모든 링크를 찾습니다.페이지와 동일한 도메인에있는 페이지에서 링크 찾기
이 페이지에는 example.com/hello.php, facebook.com/hello.php가 있다고 가정 해 보겠습니다. 그래서 나는 www.example.com/hello.php만을 열거하고 싶습니다.
PHP 간단한 HTML DOM 파서 (simplehtmldom.sourceforge.net/)를 사용하고 있습니다.
$html = file_get_html('http://www.example.com/');
// Find all links
foreach($html->find('a') as $element) {
$uri = $element->href;
//Now how to check if $uri belongs to same domain?
}