php-json is an extremely fast PHP C extension for JSON (JavaScript Object Notation) serialisation.. #PHP library #PHP C extension #JSON extension #Php-json #PHP #Library
php-json is an extremely fast PHP C extension for JSON (JavaScript Object Notation) serialisation. php-json project library uses a forked version of json-c.
It can be used in conjunction with XMLHTTPRequest to exchange JavaScript-encoded data with a browser.
A simple ./configure; make; make install should do the trick. Make sure to add an extension=json.so line to your php.ini/php.d. Note: you need to compile php-json with gcc 3.x and up.
Then, just use json_encode to encode your PHP values into JSON, and json_decode to decode JSON into a PHP value.
For example:
$output = json_encode($val); echo $output."n";
Would produce:
{ "abc": 12, "foo": "bar", "bool0": false, "bool1": true, "arr": [ 1, 2, 3, null, 5 ], "float": 1.2345 }
While:
$input = '{ "abc": 12, "foo": "bar", "bool0": false, "bool1": true, "arr": [ 1, 2, 3, null, 5 ], "float": 1.2345 }'; $val = json_decode($input); echo $val->abc."n";
Would produce:
12
As of version 1.0.5, json_decode takes an optional parameter, assoc (boolean), that returns an associative array instead of an object.
A PHP object correlates to a JavaScript object (associative array, i.e., key => value pairs), so the above would be referenced in JavaScript like so:
var obj = ...; /* retrieve JSON and eval() it, returning an object */ var result = obj["abc"] * obj["float"]; alert("result is " + result);
This should display an alert box with the value of result, i.e., 14.814.
What's New in This Release:
· A complete rewrite using JSON_checker as the base for the parser. · Implements the JSON specification. · Significant performance improvements on encoding. · Re-licensed under the PHP license.
php-json 1.2.1
add to watchlist add to download basket send us an update REPORT- runs on:
- Linux
- main category:
- Programming
- developer:
- visit homepage
Bitdefender Antivirus Free 27.0.35.146
calibre 7.9.0
Windows Sandbox Launcher 1.0.0
Context Menu Manager 3.3.3.1
Microsoft Teams 24060.3102.2733.5911 Home / 1.7.00.7956 Work
ShareX 16.0.1
Zoom Client 6.0.3.37634
IrfanView 4.67
7-Zip 23.01 / 24.04 Beta
4k Video Downloader 1.5.3.0080 Plus / 4.30.0.5655
- IrfanView
- 7-Zip
- 4k Video Downloader
- Bitdefender Antivirus Free
- calibre
- Windows Sandbox Launcher
- Context Menu Manager
- Microsoft Teams
- ShareX
- Zoom Client