Created
May 22, 2015 14:03
-
-
Save asathoor/75a2df2a7bc61b693f13 to your computer and use it in GitHub Desktop.
Write to the beginning of a textfile in php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// add to top op a file | |
$file_data = "Lorem ipsum sit dolor...\n"; | |
$file_data .= file_get_contents('text.txt'); | |
file_put_contents('text.txt', $file_data); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment