rryqszq4 / php-cjson
Fast JSON parsing and encoding support for PHP extension
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 11
Watchers: 3
Forks: 3
Open Issues: 0
Language:C
Requires
- php: >=5.3, <=5.6
This package is not auto-updated.
Last update: 2025-02-01 21:41:30 UTC
README
The php-cjson is a fast JSON parsing and encoding support for PHP extension.
Install
$/path/to/phpize
$./configure --with-php-config=/path/to/php-config
$make && make install
Example
encode
<?php $arr = array( 1, "string", array("key"=>"value") ); var_dump(cjson_encode($arr)); /* ==>output string(28) "[1,"string",{"key":"value"}]"; */ ?>
decode
<?php $str = '[1,"string",{"key":"value"}]'; var_dump(cjson_decode($str)); /* ==>output array(3) { [0]=> int(1) [1]=> string(6) "string" [2]=> array(1) { ["key"]=> string(5) "value" } } */ ?>