I am php beginner and try run some example code from http://www.w3schools.com/php/php_xml_dom.asp but I keep running into this error:
AH01071: Got error 'PHP message: PHP Parse error: syntax error, unexpected '$item' (T_VARIABLE) in test.php on line 8\n'
Can somebody help me resolving the error? This is code (test.php) I am using:
<?php
$xmlDoc = new DOMDocument();
$xmlDoc->load("note.xml");
$x = $xmlDoc->documentElement;
foreach ($x->childNodes AS $item)
{
print $item->nodeName . " = " . $item->nodeValue . "<br>";
}
?>