I need to write to this file but need to write to the top of the file?
But not replace the whole file..
Any idea's
Thanks
Newbie... But learning quickly
<?PHP
$filename = "/u01/htdocs/webstuff/temptest.txt";
$fp = fopen( $filename, 'r+a');
fwrite( $fp, $HTTP_POST_VARS['update'] . "\n");
fclose( $fp);
$fp = fopen( $filename, 'r');
$test = fread( $fp, filesize ($filename));
fclose( $fp);
$test_array = explode( "\n", $test);
for ( $i=0; $i<count($test_array); $i++){
echo $test_array[$i] . "<br>";
}
?>