eeekin_07 Posted April 19, 2007 Share Posted April 19, 2007 Hello php freaks, i am now have a problem to use logfile..the code ive got is: $logline = $ReferenceNo .'|' . $StatusLog .'|' . $RemarksLog. "\r\n"; $logfile = 'C:\apachefriends\xampp\htdocs\SisPakar\logfile.txt'; if (!$handle = fopen($logfile, 'a+')) { die("Failed to open log file"); } if (fwrite($handle, $logline) === FALSE) { die("Failed to write to log file"); } fclose($handle); } the prblems is, i want the logfile.txt(in line 3)to be in the following format :KSM_DDMMYYHHMMSS.txt is there anyone xperienced in this? help me plis... Quote Link to comment https://forums.phpfreaks.com/topic/47690-logfile/ Share on other sites More sharing options...
Guest prozente Posted April 19, 2007 Share Posted April 19, 2007 Use date(). Take a look at the format table in order to construct the format you wish. Quote Link to comment https://forums.phpfreaks.com/topic/47690-logfile/#findComment-232894 Share on other sites More sharing options...
Daniel0 Posted April 19, 2007 Share Posted April 19, 2007 $filename = "KSM_".date('dmyHis')."txt"; Quote Link to comment https://forums.phpfreaks.com/topic/47690-logfile/#findComment-232899 Share on other sites More sharing options...
eeekin_07 Posted April 19, 2007 Author Share Posted April 19, 2007 thanx for Daniel: the codes succeed...and prozente thanx for the idea.. Quote Link to comment https://forums.phpfreaks.com/topic/47690-logfile/#findComment-232954 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.