In your foreach() statement, you should use a different variable name for the expression after "as", and then use that within the loop, so that you don't clobber the original variable's value with the loop iteration value.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
In your foreach() statement, you should use a different variable name for the expression after "as", and then use that within the loop, so that you don't clobber the original variable's value with the loop iteration value.
so would it look like this:
PHP Code:
$xmlDoc = new DOMDocument();
$xmlDoc->load( 'cdocument-2012-03-03.xml' );
///// THIS IS AN EVENT TAG //////
$searchNode = $xmlDoc->getElementsByTagName( "Event" );
foreach( $searchNode as $MYsNode )
{
$valueEvent = $MYsNode->getAttribute('VALUE');
echo "Event - $valueEvent<br /><br />";
}
or would it look like:
PHP Code:
$xmlDoc = new DOMDocument();
$xmlDoc->load( 'cdocument-2012-03-03.xml' );
///// THIS IS AN EVENT TAG //////
$searchNode = $xmlDoc->getElementsByTagName( "Event" );
foreach( $searchNode as $MYsNode )
{
$valueEvent = $searchNode->getAttribute('VALUE');
echo "Event - $valueEvent<br /><br />";
}
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks