Hello, I wrote this code to quickly edit an existing XML file and save changes to the file. However, it doesn't seem to be writing my data to the xml file. Am I using asXML() wrong? Thanks for your help.
<?php
$xml = simplexml_load_file("../xml/emp.xml");
$xml->employee[0]['empID'] = $_POST['empID'];
$xml->employee[0]->empFN = $_POST['first'];
$xml->employee[0]->empLN = $_POST['last'];
$xml->employee[0]->empDept['number'] = $_POST['num'];
$xml->employee[0]->empDept->empSup = $_POST['supv'];
$xml->employee[0]->emp_ext = $_POST['ext'];
$xml->employee[0]->k_plan = $_POST['plan'];
$xml->asXML();
header('Location: confirm_form.php');
?>