<?php
$file = fopen("sample.txt", "r");
while (!feof($file)) {
echo fgets($file), "<BR>";
}
?>
<?php $file = fopen("http://www.php.net/file.txt", "r"); ?>
<?php
$file = fopen("agent.log", "a");
fputs($file, $HTTP_USER_AGENT."\n");
?>
<?php
file_put_contents("agent.log", $HTTP_USER_AGENT, FILE_APPEND);
?>