Ok now I have a problem.....
I got this class for parseing and writing xml files in php I got it from here: http://minixml.psychogenic.com/ it's called miniXML, don't know if you are familiar with it or not, anyway my problem is that my for loop dosen't appear to be firing... I can't work out why 🙁
Here is the code:
<?PHP
include_once("minixml.inc.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled mock Document</title>
</head>
<BODY>
<?PHP $timeoffset = time() - ((16*60)*60);
$date = date("d/m/y");
$time = date("G:i",$timeoffset);
$fp = fopen("test.xml", "r");
$xmlstring = fgets($fp, 1024);
fclose($fp);
$parsedDoc = new MiniXmlDoc();
$parsedDoc->fromString($xmlstring);
$rootEl =& $parsedDoc->getRoot();
echo "date ", $date, "@", $time, "<br><br>\n";
echo "location ", $location, "<BR><BR>\n";
echo "listening to ", $listeningto, "<BR><BR>\n";
echo "thinking about", $thinking, "<BR><BR>\n";
echo "mood", $mood, "<BR><BR>\n";
echo "2 words", $word1, $word2, "<BR><BR>\n";
echo "blank1", $blank1, $blank1answer, "<BR><BR>\n";
echo "blank2", $blank2, $blank2answer,"<BR><BR>\n";
echo "stress level", $stress, "%<BR><BR>\n\n\n";
echo "before for loop"; $elChildren =& $rootEl->getAllChildren();
for ($i=0; $i < $rootEl->numChildren(); $i++) {
$nName = $elChildren[$i]->name();
$nValue = $elChildren[$i]->getValue;
print "$nName\n";
echo "for loop";
print "$nValue\n\n\n";
};
?>
</BODY>
</HTML>
Don't worry about the undefined variables in the echo statements as these are being posted to this file from another file.
Any clues???