php-extended / php-data-provider-json
An implementation of php-extended/php-data-provider-json that interprets json data
4.0.0
2022-05-30 05:51 UTC
Requires
Requires (Dev)
README
An implementation of php-extended/php-data-provider-json that interprets json data.
Installation
The installation of this library is made via composer.
Download composer.phar
from their website.
Then add to your composer.json :
"require": {
...
"php-extended/php-data-provider-json": "^3"
...
}
Then run php composer.phar update
to install this library.
The autoloading of all classes of this library is made through composer's autoloader.
Basic Usage
You may use this library the following way :
use PhpExtended\DataProvider\JsonFileDataProvider;
$provider = new JsonFileDataProvider('/path/to/json.file', true);
foreach($provider->provideIterator() as $line => $data)
{
// do something
}
You may also use an in-memory data provider with a string as raw json data using
the PhpExtended\DataProvider\JsonStringDataProvider
.
License
MIT (See license file).