Using file_get_contents() and file_put_contents() in PHP


Read from and write to files in a simple manner.

Source Code

$content = file_get_contents('example.txt'); // Read file
file_put_contents('example.txt', 'Hello, World!'); // Write to file
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments