PHP code example of kaizer666 / json-preparator

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

    

kaizer666 / json-preparator example snippets

$php
use Json\JsonPreparator;

function test() {
    $on_decode('{
      "integer_with_def": 2.0002,
      "float": 123000,
      "string": "text",
      "object": {},
      "array_string": [
      "1.1.1.1.1.1.",
      "1"
      ],
      "array_integer": [
      "1.1.1.1.1.",
      "2.2.2.2."
      ],
      "array": [
        {
          "integer_with_def": 1,
          "float": 1000,
          "text": "text1"
        },{
          "integer_with_def": 2,
          "float": 2000,
          "text": "text2"
        },{
          "integer_with_def": 3,
          "float": 3000,
          "text": "text3"
        },{
          "integer_with_def": 4,
          "float": 4000,
          "text": "text4"
        }
      ]
    }', true);
                
    $preparator = new JsonPreparator($schema, $