PHP Dom not retrieving element

前端 未结 4 547
旧时难觅i
旧时难觅i 2021-01-14 23:45
$code = \'

Galeria

4条回答
  •  忘掉有多难
    2021-01-15 00:24

    You might consider DOMDocumentFragment rather than DOMDocument if you don't want headers.

    As for the id problem, this is from the manual:

    validateOnParse = true;
    $doc->Load('book.xml');
    
    echo "The element whose id is books is: " . $doc->getElementById('books')->tagName . "\n";
    
    ?> 
    

    validateOnParse is likely the issue.

提交回复
热议问题