function readfromfile($file) { $fp = fopen('$file', 'r'); if (!$fp) { echo 'Произошла ошибка при открытиии $file'; } while (false !== ($char = fgetc($fp))) { echo "$char\n"; } }