View Single Post
Old 10-05-2012, 07:09 AM   PM User | #4
kbluhm
Senior Coder

 
kbluhm's Avatar
 
Join Date: Apr 2007
Location: Philadelphia, PA, USA
Posts: 1,502
Thanks: 2
Thanked 258 Times in 254 Posts
kbluhm will become famous soon enough
Yup, it'd add the current date/time with no punctuation, such as print_r.20121005020936.txt, where 20121005020936 is October 5th, 2012, 2:09:36am, and place it in the same folder as the current file.

You could also just hard code the file name as `print_r.txt` or whatever you'd like and continue to overwrite it if you plan on checking in on the file each and every refresh.

Or use session_id() for a per-user basis:
PHP Code:
file_put_contents
    
'./print_r.' session_id() . '.' date'YmdHis' ) . '.txt'
    
print_r$_SESSIONTRUE 
); 
...but that would add up to a lot of files in a short amount of time if it's a popular site. On the other hand, overwriting would have you missing out on a lot of data as each hit would wipe the previous data.
__________________
ZCE

Last edited by kbluhm; 10-05-2012 at 07:18 AM..
kbluhm is offline   Reply With Quote