PHP code example of frictionlessdata / datapackage
1. Go to this page and download the library: Download frictionlessdata/datapackage library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
frictionlessdata / datapackage example snippets
use frictionlessdata\datapackage\Package;
$package = Package::load("tests/fixtures/multi_data_datapackage.json");
foreach ($package as $resource) {
echo $resource->name();
foreach ($resource as $row) {
echo $row;
}
}
foreach ($package as $resource) {
var_dump($resource->read());
}
Package::validate("tests/fixtures/simple_invalid_datapackage.json"); // array of validation errors