Hi..need ur guys help.I have one feedback form.The feedback form then will be kept as .txt file.My client want me to save d txt file as blow:
File name format: "enquiry-yyyyMMdd-hhmmss-X.txt" where yyyyMMdd : indicate date. example 20070816, hhmmss: indicate international time the enquiry generated in hour, minute, second. example 131520 (for 1:15:20 PM) and X: indicate the sequence no.
My problem now is.. i save d file without sequence number. I dont know how to do that..
This part of my code :
$b = 1;
$myFile = "$imagePath/irda_txt/enquiry-".date("Ymd-Gis").$b.".txt";
$fh = fopen($myFile, 'x+') or die("Can't open file");
$stringData = "$title"." $name"." $email"." $work_tel"." $mobile"." $fax"." $modecomm"." $timecomm"." $company"
." $industry"." $activities"." $website"." $enquirycat"." $enquiry";
fwrite($fh, $stringData);
fclose($fh);
txt.file format problem in PHP Urgent!!
Moderator: General Moderators
-
gilz.hippy
- Forum Newbie
- Posts: 2
- Joined: Tue Sep 16, 2008 11:30 pm
Re: txt.file format problem in PHP Urgent!!
Hi,
You can split the file name by using substr() function. Take date and time out of the filename using the substr () function, convert the data and time in timestamp using mktime() funtion and sort this time and save the respective filename in array, you will get the files in sequence.
Regards
You can split the file name by using substr() function. Take date and time out of the filename using the substr () function, convert the data and time in timestamp using mktime() funtion and sort this time and save the respective filename in array, you will get the files in sequence.
Regards
Re: txt.file format problem in PHP Urgent!!
Note: if you write URGENT!!!1 OMGz in your title, people will be less inclined to help you because you're annoying as HELL.