Это мой код:< /p>
Код: Выделить всё
$html = file_get_contents('http://xxxxxxxxx.com');
//Create a new DOM document
$dom = new DOMDocument;
//Parse the HTML. The @ is used to suppress any parsing errors
//that will be thrown if the $html string isn't valid XHTML.
@$dom->loadHTML($html);
//Get all links. You could also use any other tag name here,
//like 'img' or 'table', to extract other tags.
$links = $dom->getElementsByTagName('a');
//Iterate over the extracted links and display their URLs
foreach ($links as $link){
//Extract and show the "href" attribute.
echo $link->nodeValue;
echo $link->getAttribute('href'), '
';
}
мой z1.html имеет заголовок с именем z3. я хочу получить z1.html и z3, а не z2. Кто-нибудь может мне помочь?
Подробнее здесь: https://stackoverflow.com/questions/262 ... omdocument