PHP File Reading and Writing Example
Demonstrates file_put_contents and file_get_contents for quick file handling.
<?php
$filename = "sample.txt";
$content = "Hello, PHP File System!\nWritten on: " . date('Y-m-d');
file_put_contents($filename, $content);
$readContent = file_get_contents($filename);
echo "File Content:\n" . $readContent . "\n";
?>File Content: Hello, PHP File System! Written on: 2026-09-01