PHP code example of honzabrecka / transit-php

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

    

honzabrecka / transit-php example snippets


use transit\JSONReader;
use transit\JSONWriter;
use transit\Transit;
use transit\Map;

$transit = new Transit(new JSONReader(), new JSONWriter());
$transit->read('["^ ","foo","bar"]');
$transit->write(new Map(['foo', 'bar']));

use transit\JSONReader;
use transit\JSONWriter;
use transit\Transit;

$transit = new Transit(new JSONReader(true), new JSONWriter(true));
$transit->read('["^ ","foo","bar"]');
$transit->write(['foo' => 'bar']);

composer