<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/refs.basic.other.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'book.json.php',
    1 => 'JSON',
    2 => 'JavaScript 对象表示法（JSON）',
  ),
  'up' => 
  array (
    0 => 'refs.basic.other.php',
    1 => '其它基本扩展',
  ),
  'prev' => 
  array (
    0 => 'function.igbinary-unserialize.php',
    1 => 'igbinary_unserialize',
  ),
  'next' => 
  array (
    0 => 'json.setup.php',
    1 => '安装/配置',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'reference/json/book.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/book.json.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="book.json" class="book">
 
 <h1 class="title">JavaScript 对象表示法（JSON）</h1>
 

 <div id="intro.json" class="preface">
  <h1 class="title">简介</h1>
  <p class="para">
   本扩展实现了
   <a href="http://www.json.org/" class="link external">&raquo;&nbsp;JavaScript 对象表示法（JSON）</a>数据转换格式。PHP
   中的解析器，专门为 PHP 订制，软件许可证为 PHP license。
  </p>
  
 <blockquote class="note"><p><strong class="note">注意</strong>: 
  <p class="para">
   PHP 实现了 JSON 的一个超集，参考
   <a href="https://datatracker.ietf.org/doc/html/rfc7159" class="link external">&raquo;&nbsp;RFC 7159</a>.
  </p>
 </p></blockquote>

 </div>

 








 






 



 

 






 










<ul class="chunklist chunklist_book"><li><a href="json.setup.php">安装/配置</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="json.requirements.php">需求</a></li><li><a href="json.installation.php">安装</a></li></ul></li><li><a href="json.constants.php">预定义常量</a></li><li><a href="class.jsonexception.php">JsonException</a> — JsonException 类</li><li><a href="class.jsonserializable.php">JsonSerializable</a> — JSON 序列化接口<ul class="chunklist chunklist_book chunklist_children"><li><a href="jsonserializable.jsonserialize.php">JsonSerializable::jsonSerialize</a> — 指定需要被序列化成 JSON 的数据</li></ul></li><li><a href="ref.json.php">JSON 函数</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="function.json-decode.php">json_decode</a> — 对 JSON 格式的字符串进行解码</li><li><a href="function.json-encode.php">json_encode</a> — 对变量进行 JSON 编码</li><li><a href="function.json-last-error.php">json_last_error</a> — 返回最后发生的错误</li><li><a href="function.json-last-error-msg.php">json_last_error_msg</a> — 返回最后一次调用 json_validate()、json_encode() 或 json_decode() 时产生的错误信息</li><li><a href="function.json-validate.php">json_validate</a> — 检查一个字符串是否包含有效的JSON</li></ul></li></ul></div><?php manual_footer($setup); ?>