0

I have a file that I wish to read in php and split into smaller files.

The file is base64encoded but each section is delimited in the file with a (unecoded) tilde followed by the original filename of the base64 encoded data followed by another tilde.

As a silly example, the file could look like :

NbAYnnBBA~file1.txt~NbAYnnBBANbAYnnBBANbAYnnBBANbAYnnBBA~file2.txt~

I don't want to use file_get_contents as the files could be huge and I don't want to hit memory limited.

Can anyone think of a way of doing it without having to use fgetc to do it a char at a time ?

There are no line breaks in the file by the way - it is one continous block.

4

0 回答 0