JSON 解析/生成库 php-yajl

码农软件 · 软件分类 · JSON/BSON开发包 · 2019-03-30 23:28:07

软件介绍

php-yajl 是简单快速的 JSON 解析和生成库,YAJL(Yet Another JSON Library),绑定 PHP 扩展。 

安装:

$/path/to/phpize
$./configure --with-php-config=/path/to/php-config
$make && make install

示例

生成:

$arr = array(
    1,
    "string",
    array("key"=>"value")
);
var_dump(yajl_generate($arr));
/* ==>output
string(28) "[1,"string",{"key":"value"}]";
*/
var_dump(yajl::generate($arr));
/* ==>output
string(28) "[1,"string",{"key":"value"}]";
*/

解析

$str = '[1,"string",{"key":"value"}]';
var_dump(yajl_parse($str));
/* ==>output
array(3) {
  [0]=>
  int(1)
  [1]=>
  string(6) "string"
  [2]=>
  array(1) {
    ["key"]=>
    string(5) "value"
  }
}
*/
var_dump(yajl::parse($str));
/* ==>output
array(3) {
  [0]=>
  int(1)
  [1]=>
  string(6) "string"
  [2]=>
  array(1) {
    ["key"]=>
    string(5) "value"
  }
}
*/

本文地址:https://codercto.com/soft/d/2521.html

Charlotte's Web

Charlotte's Web

E. B. White / Puffin Classics / 2010-6-3 / GBP 6.99

This is the story of a little girl named Fern who loved a little pig named Wilbur and of Wilbur's dear friend, Charlotte A. Cavatica, a beautiful large grey spider. With the unlikely help of Templeton......一起来看看 《Charlotte's Web》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具