I am exporting data from an XML file to update my database. I use the following loop:
foreach ($xml->removed->idof as $idof) {
if ($idof > 0) {
mysql_query("delete from wp_posts WHERE import_id = '$idof'");
echo $idof;
}
}
My data structure is as follows:
<removed>
<idof mlssta='4'>0</idof>
<idof mlssta='6'>60370</idof>
<idof mlssta='14'>150370</idof>
<idof mlssta='6'>150671</idof>
...
</removed>
I need to change the condition ifin order to check the attribute value mlstaa, i.e. if ($idof > 0 && mlstaa != 6).
I just don't know how to extract it. Would love your help.
source
share