SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
-
May 19, 2003, 12: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.
Saj
-
May 19, 2003, 13:40 #2
- Join Date
- Apr 2002
- Location
- Salford / Manchester / UK
- Posts
- 4,838
- Mentioned
- 0 Post(s)
- Tagged
- 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...re·dux (adj.): brought back; returned. used postpositively
[latin : re-, re- + dux, leader; see duke.]
WaSP Accessibility Task Force Member
splintered.co.uk | photographia.co.uk | redux.deviantart.com
-
May 19, 2003, 14: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 15:56.
Bookmarks