I cant get the data between the tags into the arrays:
// Load the HTML string from file and create a SimpleXMLElement
$html_string = file_get_contents("data/csr.html"); /*the string really is in $html_string*/
$root = new SimpleXMLElement($html_string);
Problem starts here when I try to get that the value between the tags: div, h2 and span into an array
// Fetch all div, h2 and span values
$divArray = $hdlsArray = $dtlsArray = array();
foreach ($root->div as $div) {
$divArray[] = $div;
echo "".$div."<br />";
}
foreach ($root->h2 as $h2) {
$hdlsArray[] = $h2;
echo "".$h2."<br />";
}
foreach ($root->span as $span) {
$dtlsArray[] = $span;
echo "".$span."<br />";
}
The result of this is a blank page instead of printing the actual tag data