I have the the question when I write records to txt file. I want to use following script
$outputstring = $date."\t".$tireqty." tires\t".$oilqty." oil\t" $sparkqty." spark plugs\t\$".$total ."\t". $address."\n";
$fp = fopen("orders.txt", 'a');
flock($fp, LOCK_EX);
fwrite($fp, $outputstring);
flock($fp, LOCK_UN);
fclose($fp);
to add records to orders.txt file and show records as this way:
15:42, 20th April 4 tires 1 oil 6 spark plugs $434.00 22 Short St, Smalltown
15:43, 20th April 1 tires 0 oil 0 spark plugs $100.00 33 Main Rd, Newtown
But after adding, they are in one line:
15:42, 20th April 4 tires 1 oil 6 spark plugs $434.00 22 Short St, Smalltown15:43, 20th April 1 tires 0 oil 0 spark plugs $100.00 33 Main Rd, Newtown
I replaced above script with . $address."<br>
". But it can not show as what I want, and show "<br>
" between records.
How can I show the records line by line when writing in the txt file?
Thank!