Hello guys,
How will i do txt formatting like this. the current date is at the top
date.txt
05/16/04
test1
05/15/04
test2
05/14/04
test3
Normally,
05/14/04
test1
05/15/04
test2
05/16/04
test3
this is the code i use w/c display the second example.
@extract($_POST);
if(is_writable('data.txt'))
{
$fp = fopen('data.txt','a');
$filename=$_POST['filename'];
$message=$_POST['post'];
$date=date('m/d/y');
$content ="$date
$filename
$message
"
;
fwrite($fp,$content);
fclose($fp);
}
else
{
echo'File is not writable';
}
?>