When the php writes back to the xml...if any of the fields (already existing or ones your php creates) have no data (I have some quotes that do not have references), instead of writing
Code:
<reference></reference>
the php/simplexml writes I use a Spry Data Set to place the sidebar on my .html pages but it's very picky about opening and closing tags.
Is there an easy way to tell the code to add both tags?
Code:
$dcount = $_POST["dcount"]'
$file = '../sidebar.xml';
$xml = simplexml_load_file($file);
$i = 0;
foreach($xml as $kid){
if(in_array($kid->id, $dcount)){
unset($xml->myquotes[$i]);
break;
}
$i++;
}
$xml = $xml->asXML($file);
or is that something you have to put up with when using simplexml?
my xml looks like...
Code:
<sidebar>
<myquotes>
<id></id>
<thequote></thequote>
<reference></thereference>
</myquote>
</sidebar>
Bookmarks