note 43179 added to function.fwrite
| From: | suthertatyahoodotcom at rn2 dot php dot net | Date: | Sat, 12 Jun 2004 03:07:22 +0000 |
| Subject: | note 43179 added to function.fwrite | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-70954@lists.php.net to get a copy of this message | ||
i've tried to append to the front of a file :( no luck... so i did this:
if (file_exists($blogfile)) {
$handle = fopen($blogfile, "rb");
$contents = fread($handle, filesize($blogfile));
fclose($handle);
}
if (file_exists($blogfile)) {
$handle = fopen($blogfile, "wb");
fwrite($handle, $writeblog);
fwrite($handle, $contents);
fclose($handle);
}
i may have rudimentary errors there - but it worls :)
now i just need to read line by line :P
----
Manual Page -- http://www.php.net/manual/en/function.fwrite.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+43179
Delete -- http://master.php.net/manage/user-notes.php?action=delete+43179&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+43179&report=yes
Search -- http://master.php.net/manage/user-notes.php