note; $field_count = count($test); for($i=0;$i<$field_count;$i++){ if($nb <= $test[$i]['id']) $nb = $test[$i]['id']+1; } $newnote = $xmla->addChild('link'); $newnote->addChild('name', $name); $newnote->addChild('number', $number); $newnote->addChild('url', $url); $xmla->asXML('../db/blog_links.xml'); echo $nb; ?>