Append to a file
function fileWrite($file, $message) {
fwrite(fopen($file, 'a'), $message . "\n");
}
Read and display entire file
function fileRead($file){
$lines = file($file);
foreach ($lines as $line_num => $line) {
echo $line, '</br>';
}
}
Small and functional PHP file reading snippet.
Very elegance of the solution. Partition with can see at a glance how to use code