<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.mbstring.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'function.mb-parse-str.php',
    1 => 'mb_parse_str',
    2 => '解析 GET/POST/COOKIE 数据并设置全局变量',
  ),
  'up' => 
  array (
    0 => 'ref.mbstring.php',
    1 => '多字节字符串 函数',
  ),
  'prev' => 
  array (
    0 => 'function.mb-output-handler.php',
    1 => 'mb_output_handler',
  ),
  'next' => 
  array (
    0 => 'function.mb-preferred-mime-name.php',
    1 => 'mb_preferred_mime_name',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'reference/mbstring/functions/mb-parse-str.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.mb-parse-str" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mb_parse_str</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.6, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">mb_parse_str</span> &mdash; <span class="dc-title">解析 GET/POST/COOKIE 数据并设置全局变量</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.mb-parse-str-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>mb_parse_str</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$string</code></span>, <span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter reference">&$result</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   解析 GET/POST/COOKIE 数据并设置全局变量。
   由于 PHP 不提供原始 POST/COOKIE 数据，目前它仅能够用于 GET 数据。
   它解析了 URL 编码过的数据，检测其编码，并转换编码为内部编码，然后设置其值为 <span class="type"><a href="language.types.array.php" class="type array">array</a></span> 的 <code class="parameter">result</code> 或者全局变量。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mb-parse-str-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">string</code></dt>
     <dd>
      <p class="para">
       URL 编码过的数据。
      </p>
     </dd>
    
    
     <dt><code class="parameter">result</code></dt>
     <dd>
      <p class="para">
       一个 <span class="type"><a href="language.types.array.php" class="type array">array</a></span>，包含解码过的、编码转换后的值。
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.mb-parse-str-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>， 或者在失败时返回 <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>。
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.mb-parse-str-changelog">
  <h3 class="title">更新日志</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>版本</th>
      <th>说明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>第二个参数不再可选。</td>
     </tr>

     <tr>
      <td>7.2.0</td>
      <td>弃用在没有第二个参数的时候调用 <span class="function"><strong>mb_parse_str()</strong></span>。</td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.mb-parse-str-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.mb-detect-order.php" class="function" rel="rdfs-seeAlso">mb_detect_order()</a> - 设置/获取 字符编码的检测顺序</span></li>
    <li><span class="function"><a href="function.mb-internal-encoding.php" class="function" rel="rdfs-seeAlso">mb_internal_encoding()</a> - 设置/获取内部字符编码</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>