Add files via upload

This commit is contained in:
Zepher Ashe 2022-11-15 23:18:28 +00:00 committed by GitHub
parent e03c08cd74
commit 9f1c926400
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,13 +5,16 @@ class DomDocumentParser
public function __construct($url)
{
$html = '<?xml encoding="UTF-8">';
$options = array(
'http'=>array('method'=>"GET", 'header'=>"User-Agent: doogleBot/0.1\n")
);
$context = stream_context_create($options);
$getConstants = file_get_contents($url, false, $context);
$this->doc = new DomDocument();
@$this->doc->loadHTML(file_get_contents($url, false, $context));
$this->doc = new DomDocument('1.0', 'utf-8');
@$this->doc->loadHTML($html . $getConstants);
//@ Error supression is unnecessary, PHP>7.0 supports HTML5
}