PHP code example of devlop / json

1. Go to this page and download the library: Download devlop/json 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/ */

    

devlop / json example snippets


use Devlop\Json\Json;

$output = Json::encode($input);

// or with flags
$output = Json::encode($input, \JSON_HEX_TAG | \JSON_NUMERIC_CHECK);

use Devlop\Json\Json;

$output = Json::pretty($input);

// or with flags
$output = Json::encode($input, \JSON_HEX_TAG | \JSON_NUMERIC_CHECK);

use Devlop\Json\Json;

$output = Json::decode($input);

// or with flags
$output = Json::decode($input, \JSON_INVALID_UTF8_IGNORE);

use Devlop\Json\Json;

$output = Json::decodeAssoc($input);

// or with flags
$output = Json::decodeAssoc($input, \JSON_INVALID_UTF8_IGNORE);

$output = Json::encode($input, Json::NO_FLAGS, 3);