Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- function writeToFile($path,$itemnames,$itemquants,$itemprices){
- $w = fopen($path,'w');
- fwrite($w,'<?xml version="1.0"?>'."\n");
- fwrite($w,'<order>'."\n");
- fwrite($w,'\t<username>Dumbasss Mc Fuckup</username>'."\n");
- fwrite($w,'\t<day>'.date("d.m.Y").'</day>'."\n");
- fwrite($w,'\t<time>'.date("H:i:s").'</time>'."\n");
- for($i=0;$i<count($itemnames);$i++){
- fwrite('<\titem>'."\n");
- fwrite('\t\t<itemname>'.$itemnames[$i].'</itemname>'."\n");
- fwrite('\t\t<quantity>'.$itemquants[$i].'</quantity>'."\n");
- fwrite('\t\t<price>'.$itemprices[$i].'</price>'."\n");
- fwrite('\t</item>'."\n");
- }
- fwrite($w,'</order>'."\n");
- fclose($w);
- }
- ?>
Add Comment
Please, Sign In to add comment