What you are saying makes perfect sense and it's right because I'm getting something now, but for some reason I'm getting an error when I remove the htmlspecialchars().
Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseEntityRef: expecting ';' in Entity, line: 1221 in /home/isaiahb/public_html/game_schedules_bears.php on line 10
Here's the full line of code that I'm tampering with:
<?php
$ch = curl_init('http://www.chicagobears.com/gameday/schedule.html');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
$bears_html = curl_exec($ch);
$bears_games = new DOMDocument();
$bears_games->preserveWhiteSpace = false;
$bears_games->loadHTML($bears_html);
echo $bears_games->getElementsByTagName('div')->item(0)->nodeValue;
curl_close($ch);
?>
This is weird because I wasn't getting anything when I echoed the nodeValue, but when I removed htmlspecialchars I get something even though it's not what I want. If you click on the link you'll see what I mean.