function modTagg($new, $old) { $data = simplexml_load_file("../Ressources/Tags.xml"); for ($i = 0, $length = count($data->Tag); $i < $length; $i++) { if ($data->Tag[$i]->name == $old) { unset($data->Tag[$i]); break; } } $data->asXML('../Ressources/Tags.xml'); saveTagg($new); }
function addTag() { if (isset($_POST['cat'])) { if (checkTag($_POST['cat']) == 0) { saveTagg($_POST['cat']); } } }