Delete Range of Data From Text File With PHP

Posted by Evan Byrne on Stack Overflow See other posts from Stack Overflow or by Evan Byrne
Published on 2010-03-24T21:17:45Z Indexed on 2010/03/24 21:23 UTC
Read the original article Hit count: 257

Filed under:
|

I want to delete a range of data from a text file using PHP. Let's assume the file contains the following:

Hello, World!

I want to delete everything from character 2 to character 7. The actual file I need to do this with is very large, so I don't want to have to read the large file in order to delete just a small, given range of data. The data contained within the given range is not known, so str_replace or preg_replace solutions wouldn't work anyways.

Thanks!

© Stack Overflow or respective owner

Related posts about php

Related posts about filesystem