Reputation: 5
I am looking to save an xml file to a different directory from the root using php5. any ideas?
//write to the file
$filename = $id . ".xml";
$doc->save($filename);
I want to save the file to the /xml/
directory.
Upvotes: 0
Views: 2714
Reputation: 60413
Change the argument to $doc->save
to include the path
$filename = '/xml/' . $id . ".xml";
$doc->save($filename);
Now the thing to bear in mind is that this is a filesystem path, not web URL so its literally going to save in /xml
not DOCUMENT_ROOT/xml
.
Upvotes: 3