Results 1 to 3 of 3
May 19, 2003, 11:32 #1
Fwrite to the middle of a document?
I don't think this is possible at all, but are there any other alternatives to this? What I want to do is to write in a text file right after a HTML comment, but keeping all other information in tact.
Help would be greatly appreciated.
May 19, 2003, 12:40 #2
- Join Date
- Apr 2002
- Salford / Manchester / UK
- 0 Post(s)
- 0 Thread(s)
you could always fopen and fread the file, then do a str_replace, replacing the html comment with whatever you want to write there, plus the html comment itself (either before or after the new content you just wrote, depending on exactly what you're trying to do).
this way, the html comment is always there where you need it...
May 19, 2003, 13:21 #3
Ok, I havn't used that before. Could you give an example or a site that has an example? I find it easier to work after seeing something work first.
Also, in fread(), while using the filesize, is there a way to say to read all of the document, regardless of the size?
Thanks for your help.
Last edited by Saj; May 19, 2003 at 14:56.