<?php
function readTextFile($handle, $numToRead)
{
if($handle == -1)
{
echo "Error- Invalid File Handle";
return;
}
$fileContents = "";
$fileContents == fread($handle,$numToRead);
return $fileContents;
}
function openTextFile($fileName)
{
$handle = -1;
if(is_readable($fileName) == true)
{
$handle = fopen($fileName,"r");
}
return $handle;
}
$contents = "";
$handler = "";
$handler = openTextFile('people.txt');
$contents = readTextFile($handler,10);
echo $contents;
?>
thanks