I came up with this idea yesterday:
function read_and_delete_first_line($filename) {
$file = file($filename);
$output = $file[0];
unset($file[0]);
file_put_contents($filename, $file);
return $output;
}
More Related Contents:
- Adding files cookies PHP (host)
- How do I add PHP code/file to HTML(.html) files?
- How to delete a line from the file with php?
- PHP, get file name without file extension
- Upload a file using PHP
- Need to write at beginning of file with PHP
- Reading and Writing Configuration Files
- Count how many files in directory PHP
- Read a plain text file with php
- PHP: how can I get file creation date?
- PHP: Check if a file is loaded directly instead of including?
- Read a file backwards line by line using fseek
- Save current page as HTML to server
- How to copy a file from one directory to another using PHP?
- uploading a file in chunks using html5
- PHP: Read Specific Line From File
- PHP Warning: move_uploaded_file() unable to move
- PHP what is the best way to write data to middle of file without rewriting file
- File not uploading PHP
- How can I view/open a word document in my browser using with PHP or HTML
- Replace string in text file using PHP
- List and download clicked file from FTP
- Save PHP variables to a text file
- Max file number can php upload at same time
- How can I get the current script file name, but without the extension “.php”?
- A PHP script to let users download a file from my website without revealing the actual file link in my website?
- Copy file from remote server or URL [duplicate]
- Can I read a .TXT file with PHP?
- php script to delete files older than 24 hrs, deletes all files
- How to execute and get content of a .php file in a variable?