PicoraJSON

JSON support for PHP < 5.2

This class is a thin wrapper around the Services_JSON library.

PicoraJSON::encode(array('key'=>'value'));
PicoraJSON::decode("{'key':'value'}");

JSON support is built in with PHP 5.2. This class provides backwards compatibility with PHP 5.0 - 5.1.

Method Overview

Return Visibility Name Parameters
mixed static public decode (string $data)
string static public encode (mixed $data)

Method Detail

static public decode()

Parameter Type Name Description
string $data

static public encode()

Parameter Type Name Description
mixed $data

Declared in: PicoraJSON.php

class PicoraJSON {
    /**
     * @param mixed $data
     * @return string
     */
    static public function encode($data){
        static $o;
        if(!isset($o))
            $o = new Services_JSON();
        return $o->encode($data);
    }
    /**
     * @param string $data
     * @return mixed
     */
    static public function decode($data){
        static $o;
        if(!isset($o))
            $o = new Services_JSON();
        return $o->decode($data);
    }
}