Again, you do not understand text files and how you are planning on using them is totally wrong.
First, you want to load text into a file so that makes it larger. But, you want to edit the file live, so that means
a complicated process to determine the end-of-lines in the PHP file. Which you want to be live programming
text which then gets re-compiled into an array when the page loads. That is a ton of work. just use the array
that you are creating anyways and store it with my last two lines of code. All PHP files are loaded into memory
when they are called. So, you waste the server’s time loading a text file, turning it into php file text and then
have the server convert the text into an array in memory instead of just saving and loading it using PHP functions
created just for that use.
The object here is that you want to slow down your page and have us create a way to do the code badly.
If you don’t want us to help you do this correctly, okay. Then, read the hex values of your file and figure out
what the end-of-line characters are. Then you can write code to use the string_replace() function to remove
the second line. You would have to use the string_position() function to find the EOL and then use that and
the position of the next EOL and replace the data between them with “” (null text) and that will work. BUT, it
is so slow compared to manipulating your array and storing it, perhaps about 100 times a slow and if you have
a large number of users on the server, it will waste server resources and slow the server down. Your choice!