\n"; $aPopXml = array(); do { $Elt = array_pop($aXmlContent); array_push($aPopXml, $Elt); } while (count($aXmlContent) && (!strstr($Elt, "/personnel"))); array_push($aXmlContent, $nvLigne); while (count($aPopXml)) { array_push($aXmlContent, array_pop($aPopXml)); } if ($fp = fopen("Calendrier.xml", "wb")) { fwrite($fp, implode("", $aXmlContent)); fclose($fp); } else echo "pb fichier"; ?>