2017 © Pedro Peláez
 

library php-ubjson

image

fandogh/php-ubjson

  • Saturday, July 30, 2016
  • by pooya
  • Repository
  • 1 Watchers
  • 1 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 7 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

PHP-UBJSON

Packagist Packagist, (*1)

A library to read and write to the Universal Binary JSON (Draft 9) format using PHP, (*2)

Install using composer

Using command line:, (*3)

composer require fandogh/php-ubjson

Or add this to your composer.json file:, (*4)

"require": {
  ...
  "fandogh/php-ubjson": "^0.2.2",
  ...
}

Usage

PLEASE NOTE THAT ENCODED RESULT IS A BINARY STRING and some charachters are non printable!!, (*5)

// Don't forget to require autoload.php with correct path
require './vendor/autoload.php';

// Test data
$payload = ['hello'=>123];

// Encode using UBJSON
$encoded = \UBJSON::encode($payload);

# Incorrect! 
echo($encoded); // {SUhelloU{}

# Correct!
echo(bin2hex($encoded)); // "7b53550568656c6c6f557b7d"

// Test decoding
$decoded = \UBJSON::decode($encoded);

var_dump($decoded); // array(1) { ["hello"]=> int(123) }

Licence

This code is distributed under BSD license., (*6)

The Versions

30/07 2016

dev-master

9999999-dev

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

by Vladimir Zbrailov
by Pooya Parsa

30/07 2016

v0.2.2

0.2.2.0

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

by Vladimir Zbrailov
by Pooya Parsa

30/07 2016

v0.2.1

0.2.1.0

  Sources   Download

The Requires

  • php >=5.3.0

 

by Vladimir Zbrailov
by Pooya Parsa

30/05 2015

v0.2

0.2.0.0

  Sources   Download

The Requires

  • php >=5.3.0

 

by Vladimir Zbrailov

08/07 2013

v0.1

0.1.0.0

  Sources   Download

The Requires

  • php 5.3.0

 

by Vladimir Zbrailov