PHP code example of mateodioev / jsondecoder
1. Go to this page and download the library: Download mateodioev/jsondecoder 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/ */
mateodioev / jsondecoder example snippets
use Mateodioev\Json;
class User {
public int $id;
public string $name;
public string $username;
}
$jsonRaw = '{"id": 1, "name": "Mateo", "username": "mateodioev"}';
$json = new JSON($jsonRaw);
$u = new User;
$json->decode($u)
var_dump($u);
Mateodioev\Json\JsonDecodeException