I have several identical elements with different attributes that I\'m accessing with SimpleXML:
A new idea: simple_xml
works as a array.
We can search for the indexes of the "array" we want to delete, and then, use the unset()
function to delete this array indexes. My example:
$pos=$this->xml->getXMLUser();
$i=0; $array_pos=array();
foreach($this->xml->doc->users->usr[$pos]->u_cfg_root->profiles->profile as $profile) {
if($profile->p_timestamp=='0') { $array_pos[]=$i; }
$i++;
}
//print_r($array_pos);
for($i=0;$ixml->doc->users->usr[$pos]->u_cfg_root->profiles->profile[$array_pos[$i]]);
}