<?php include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc'; $TOC = array(); $TOC_DEPRECATED = array(); $PARENTS = array(); include_once dirname(__FILE__) ."/toc/class.quickhashstringinthash.inc"; $setup = array ( 'home' => array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'quickhashstringinthash.get.php', 1 => 'QuickHashStringIntHash::get', 2 => 'This method retrieves a value from the hash by its key', ), 'up' => array ( 0 => 'class.quickhashstringinthash.php', 1 => 'QuickHashStringIntHash', ), 'prev' => array ( 0 => 'quickhashstringinthash.exists.php', 1 => 'QuickHashStringIntHash::exists', ), 'next' => array ( 0 => 'quickhashstringinthash.getsize.php', 1 => 'QuickHashStringIntHash::getSize', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/quickhash/quickhashstringinthash/get.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?> <div id="quickhashstringinthash.get" class="refentry"> <div class="refnamediv"> <h1 class="refname">QuickHashStringIntHash::get</h1> <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">QuickHashStringIntHash::get</span> — <span class="dc-title">This method retrieves a value from the hash by its key</span></p> </div> <div class="refsect1 description" id="refsect1-quickhashstringinthash.get-description"> <h3 class="title">说明</h3> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="methodname"><strong>QuickHashStringIntHash::get</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$key</code></span>): <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span></div> <p class="para rdfs-comment"> This method retrieves a value from the hash by its key. </p> </div> <div class="refsect1 parameters" id="refsect1-quickhashstringinthash.get-parameters"> <h3 class="title">参数</h3> <p class="para"> <dl> <dt><code class="parameter">key</code></dt> <dd> <p class="para"> The key of the entry to retrieve. </p> </dd> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-quickhashstringinthash.get-returnvalues"> <h3 class="title">返回值</h3> <p class="para"> The value if the key exists, or <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> if the key wasn't part of the hash. </p> </div> <div class="refsect1 examples" id="refsect1-quickhashstringinthash.get-examples"> <h3 class="title">示例</h3> <p class="para"> <div class="example" id="example-5417"> <p><strong>示例 #1 <span class="function"><strong>QuickHashStringIntHash::get()</strong></span> example</strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB"><?php<br />$hash </span><span style="color: #007700">= new </span><span style="color: #0000BB">QuickHashStringIntHash</span><span style="color: #007700">( </span><span style="color: #0000BB">8 </span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">( </span><span style="color: #0000BB">$hash</span><span style="color: #007700">-></span><span style="color: #0000BB">get</span><span style="color: #007700">( </span><span style="color: #DD0000">"one" </span><span style="color: #007700">) );<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">( </span><span style="color: #0000BB">$hash</span><span style="color: #007700">-></span><span style="color: #0000BB">add</span><span style="color: #007700">( </span><span style="color: #DD0000">"two"</span><span style="color: #007700">, </span><span style="color: #0000BB">2 </span><span style="color: #007700">) );<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">( </span><span style="color: #0000BB">$hash</span><span style="color: #007700">-></span><span style="color: #0000BB">get</span><span style="color: #007700">( </span><span style="color: #DD0000">"two" </span><span style="color: #007700">) );<br /></span><span style="color: #0000BB">?></span></span></code></div> </div> <div class="example-contents"><p>以上示例的输出类似于:</p></div> <div class="example-contents screen"> <div class="examplescode"><pre class="examplescode">bool(false) bool(true) int(2)</pre> </div> </div> </div> </p> </div> </div><?php manual_footer($setup); ?>