1. Go to this page and download the library: Download kkamkou/collection-json.php 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/ */
kkamkou / collection-json.php example snippets
use \CollectionJson\Collection;
use \CollectionJson\Property;
$data = new Property\Data('firstName', 'Duck', 'Full name');
$link = new Property\Link('http://example.com', 'homepage', 'Homepage', 'link', 'Link to the homepage');
$item = new Collection\Item('http://example.com/item');
$item->addData($data)->addLink($link);
$collection = new Collection('http://example.com');
$collection->addItem($item);
echo $collection;