1. Go to this page and download the library: Download francerz/json-tools 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/ */
francerz / json-tools example snippets
use Francerz\JsonTools\JsonMap;
use Francerz\JsonTools\JsonMappedInterface;
class Student implements JsonMappedInterface
{
private $studentId;
private $givenName;
private $familyName;
public function getJsonMaps()
{
return [
new JsonMap('id', 'studentId'),
new JsonMap('given_name', 'givenName'),
new JsonMap('family_name', 'familyName')
];
}
}