PHPackages                             fostam/file - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. fostam/file

ActiveLibrary[File &amp; Storage](/categories/file-storage)

fostam/file
===========

Convenience wrapper for PHP functions like `fopen()`, `fgets()` that offers object oriented usage and handles errors with exceptions instead of return results.

v2.0.0(11mo ago)010Apache-2.0PHPPHP ^8.2

Since Dec 29Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/fostam/php-file)[ Packagist](https://packagist.org/packages/fostam/file)[ RSS](/packages/fostam-file/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

fostam/file
===========

[](#fostamfile)

**File** is a simple convenience wrapper for PHP functions like `fopen()`, `fgets()`. It offers object oriented usage of file functions, and handles errors with exceptions instead of return results and PHP warnings/errors.

Install
-------

[](#install)

The easiest way to install **File** is by using [composer](https://getcomposer.org/):

```
$> composer require fostam/file

```

Usage
-----

[](#usage)

**Example:** print the contents of a file, line by line

```
