<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.yaconf.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ja',
  ),
  'this' => 
  array (
    0 => 'yaconf.get.php',
    1 => 'Yaconf::get',
    2 => 'Retrieve a item',
  ),
  'up' => 
  array (
    0 => 'class.yaconf.php',
    1 => 'Yaconf',
  ),
  'prev' => 
  array (
    0 => 'class.yaconf.php',
    1 => 'Yaconf',
  ),
  'next' => 
  array (
    0 => 'yaconf.has.php',
    1 => 'Yaconf::has',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/yaconf/yaconf/get.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="yaconf.get" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Yaconf::get</h1>
  <p class="verinfo">(PECL yaconf &gt;= 1.0.0)</p><p class="refpurpose"><span class="refname">Yaconf::get</span> &mdash; <span class="dc-title">Retrieve a item</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-yaconf.get-description">
  <h3 class="title">説明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><strong>Yaconf::get</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$name</code></span>, <span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$default_value</code><span class="initializer"> = NULL</span></span>): <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span></div>

  <p class="para rdfs-comment">

  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-yaconf.get-parameters">
  <h3 class="title">パラメータ</h3>
  <dl>
   
    <dt><code class="parameter">name</code></dt>
    <dd>
     <p class="para">
      Configuration key, the key looks like &quot;filename.key&quot;, or &quot;filename.sectionName,key&quot;.
     </p>
    </dd>
   
   
    <dt><code class="parameter">default_value</code></dt>
    <dd>
     <p class="para">
      if the key doesn&#039;t exists, Yaconf::get will return this as result.
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-yaconf.get-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="para">
   Returns configuration result(string or array) if the key exists,
   return default_value if not.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-yaconf.get-examples">
  <h3 class="title">例</h3>
  <div class="example" id="example-1">
   <p><strong>例1 <span class="function"><strong>INI()</strong></span>example</strong></p>
   <div class="example-contents">
<div class="inicode"><pre class="inicode">;filenmame foo.ini, placed in directory which is yaconf.directoy
[SectionA]
;key value pair
key=val
;hash[a]=val
hash.a=val
;arr[0]=val
arr.0=val
;or
arr[]=val

;SectionB inherits SectionA
[SectionB:SectionA]
;override configuration key in SectionA
key=new_val</pre>
</div>
   </div>

   <div class="example-contents"><p>上の例の出力は、
たとえば以下のようになります。</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">php7 -r &#039;var_dump(Yaconf::get(&quot;foo.SectionA.key&quot;));&#039;
//string(3) &quot;val&quot;

php7 -r &#039;var_dump(Yaconf::get(&quot;foo.SectionB.key&quot;));&#039;
//string(7) &quot;new_val&quot;

php7 -r &#039;var_dump(Yaconf::get(&quot;foo&quot;)[&quot;SectionA&quot;][&quot;hash&quot;]);&#039;
//array(1)</pre>
</div>
   </div>
  </div>
 </div>


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