The quick and dirty:
<?php
$file_data = "Stuff you want to add\n";
$file_data .= file_get_contents('database.txt');
file_put_contents('database.txt', $file_data);
?>
More Related Contents:
- PHP Upload fails for Video but not Image [closed]
- PHP create file with specific name [closed]
- How to force file download with PHP
- How to write into a file in PHP?
- Reading and Writing Configuration Files
- Count how many files in directory PHP
- Read a plain text file with php
- including php file from another server with php
- Move_uploaded_file() function is not working
- 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
- uploading a file in chunks using html5
- PHP: Read Specific Line From File
- PHP Warning: move_uploaded_file() unable to move
- File not uploading PHP
- How can I view/open a word document in my browser using with PHP or HTML
- PHP move_uploaded_file() error?
- How to concatenate PHP variable name?
- Replace string in text file using PHP
- How to save memory when reading a file in Php?
- List and download clicked file from FTP
- Max file number can php upload at same time
- Difference between file, file_get_contents, and fopen in 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]
- Is this the most efficient way to get and remove first line in file?
- How download big file using PHP (low memory usage)
- What is the difference between $_FILES[“file”][“type”] and end(explode(“.”, $_FILES[“file”][“name”])) [closed]
- Sort directory files by creation datetime in Windows filesystem