note as $s) { if ($s['id']==$id) { $target = $i; break; } $i++; } if ($target !== false) { unset($xmla->note[$target]); } $xmla->asXML('../db/notes.xml'); $target++; echo $target; ?>