PHP appending to file from specific position

后端 未结 2 958
借酒劲吻你
借酒劲吻你 2021-01-20 19:24

In php i am opening a text file and appending to it. However I need to append 3 chars before the end of file. In other words i need to append/write from a specific place in

2条回答
  •  庸人自扰
    2021-01-20 20:08

    You need to open the file for edit, seek to the desired position and then write to the file, eg.:

    
    

    Further reference at php.net - fseek doc

    Hope that helps.

提交回复
热议问题