Usa la funzione file

http://www.php.net/manual/it/function.file.php