We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e03c08c commit 9f1c926Copy full SHA for 9f1c926
classes/DomDocumentParser.php
@@ -5,13 +5,16 @@ class DomDocumentParser
5
6
public function __construct($url)
7
{
8
+ $html = '<?xml encoding="UTF-8">';
9
+
10
$options = array(
11
'http'=>array('method'=>"GET", 'header'=>"User-Agent: doogleBot/0.1\n")
12
);
13
$context = stream_context_create($options);
14
+ $getConstants = file_get_contents($url, false, $context);
15
- $this->doc = new DomDocument();
- @$this->doc->loadHTML(file_get_contents($url, false, $context));
16
+ $this->doc = new DomDocument('1.0', 'utf-8');
17
+ @$this->doc->loadHTML($html . $getConstants);
18
//@ Error supression is unnecessary, PHP>7.0 supports HTML5
19
}
20
0 commit comments