How to read the contents of a file in PHP ?

Read the contents of a file in PHP
<?php

$fileName = “file01.txt”;
//fopen() function is used to open a file in php
$file = fopen($fileName,”r”) or exit(“Unable to open the file!”) ;
While(!feof($file)) // feof()checks the end of file in php
{
echo fgets($file); // fgets() read a fileline by line in php
}
fclose($file); // fclose() used to close a file in php

?>