PHP fseek and fwrite help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
IamTK
Forum Newbie
Posts: 7
Joined: Tue Aug 28, 2007 11:16 am

PHP fseek and fwrite help

Post by IamTK »

How do i use Fseek() without having fwrite() replace whatever's there before?

Like I want to seek the pointer to a certain spot, then use fwrite to write something there without replacing what's there already.

And how do I move the pointer down instead of just to the right? Fseek only moves the pointer to the right on the same line of code, I want to be able to move up and down rows, how can i do that?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You will have to read all data after it into a buffer which you add after your insertion.
IamTK
Forum Newbie
Posts: 7
Joined: Tue Aug 28, 2007 11:16 am

Post by IamTK »

feyd wrote:You will have to read all data after it into a buffer which you add after your insertion.
How do I read the data into a buffer?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

fread() may be a start.
IamTK
Forum Newbie
Posts: 7
Joined: Tue Aug 28, 2007 11:16 am

Post by IamTK »

feyd wrote:fread() may be a start.
ah i see.

Thank you very much for your help!
Post Reply