protected function jsonify($data)
    {
        // JSON_NUMERIC_CHECK removes leading zeros
        // which is an issue in cases like postcode e.g. 00160
        // see https://bugs.php.net/bug.php?id=64695
        $json = json_encode($data);

        //catch JSON parsing error
        $error = RESTfulAPIError::get_json_error();
        if ($error !== false) {
            return new RESTfulAPIError(400, $error);
        }

        return $json;
    }
protected function jsonify($data)
    {
        // JSON_NUMERIC_CHECK removes leading zeros
        // which is an issue in cases like postcode e.g. 00160
        // see https://bugs.php.net/bug.php?id=64695
        $json = json_encode($data);

        //catch JSON parsing error
        $error = RESTfulAPIError::get_json_error();
        if ($error !== false) {
            return new RESTfulAPIError(400, $error);
        }

        return $json;
    }
protected function jsonify ( $ data ) { // JSON_NUMERIC_CHECK removes leading zeros // which is an issue in cases like postcode e.g. 00160 // see https://bugs.php.net/bug.php?id=64695 $ json = json_encode ( $ data ) ; //catch JSON parsing error $ error = RESTfulAPIError :: get_json_error ( ) ; if ( $ error !== false ) { return new RESTfulAPIError ( 400 , $ error ) ; } return $ json ; }
Convert data into a JSON string

@param  mixed  $data Data to convert
@return string       JSON data
Convert data into a JSON string