SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot Saj's Avatar
    Join Date
    May 2003
    Location
    USA
    Posts
    121
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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

  2. #2
    gingham dress, army boots... silver trophy redux's Avatar
    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

  3. #3
    SitePoint Zealot Saj's Avatar
    Join Date
    May 2003
    Location
    USA
    Posts
    121
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •