create a text file programmatically in wordpress
$time = date( "F jS Y, H:i", time()+25200 );
$ban = "#$time\r\n$location\r\n"; 
$file = dirname(__FILE__) . "/post_data.txt_$time"; 
$open = fopen( $file, "a" ); 
$write = fputs( $open, $ban ); 
fclose( $open );