<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.locale.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'pt_BR',
  ),
  'this' => 
  array (
    0 => 'locale.acceptfromhttp.php',
    1 => 'Locale::acceptFromHttp',
    2 => 'Tenta descobrir a melhor localidade dispon&iacute;vel baseado no cabe&ccedil;alho HTTP &quot;Accept-Language&quot;',
  ),
  'up' => 
  array (
    0 => 'class.locale.php',
    1 => 'Locale',
  ),
  'prev' => 
  array (
    0 => 'class.locale.php',
    1 => 'Locale',
  ),
  'next' => 
  array (
    0 => 'locale.canonicalize.php',
    1 => 'Locale::canonicalize',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'pt_BR',
    'path' => 'reference/intl/locale/accept-from-http.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="locale.acceptfromhttp" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Locale::acceptFromHttp</h1>
  <h1 class="refname">locale_accept_from_http</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.0, PHP 7, PHP 8, PECL intl &gt;= 1.0.0)</p><p class="refpurpose"><span class="refname">Locale::acceptFromHttp</span> -- <span class="refname">locale_accept_from_http</span> &mdash; <span class="dc-title">Tenta descobrir a melhor localidade disponível baseado no cabeçalho HTTP &quot;Accept-Language&quot;</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-locale.acceptfromhttp-description">
  <h3 class="title">Descrição</h3>
  <p class="para">
   Estilo orientado a objetos
  </p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><strong>Locale::acceptFromHttp</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$header</code></span>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Estilo procedural
  </p>
  <div class="methodsynopsis dc-description"><span class="methodname"><strong>locale_accept_from_http</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$header</code></span>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Tenta encontrar a localidade que satisfaça a lista de línguas que é requisitada pelo
   cabeçalho HTTP &quot;Accept-Language&quot;.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-locale.acceptfromhttp-parameters">
  <h3 class="title">Parâmetros</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">header</code></dt>
     <dd>
      <p class="para">
       A string contendo o cabeçalho &quot;Accept-Language&quot; de acordo com o formato RFC 2616.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>



 <div class="refsect1 returnvalues" id="refsect1-locale.acceptfromhttp-returnvalues">
  <h3 class="title">Valor Retornado</h3>
  <p class="para">
   O identificador de localidade correspondente.
  </p>
  <p class="para">
   Retorna <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> quendo o comprimento de <code class="parameter">header</code> exceder
   <strong><code><a href="intl.constants.php#constant.intl-max-locale-len">INTL_MAX_LOCALE_LEN</a></code></strong>.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-locale.acceptfromhttp-examples">
  <h3 class="title">Exemplos</h3>
  <div class="example" id="example-1">
   <p><strong>Exemplo #1 Exemplo de <span class="function"><strong>locale_accept_from_http()</strong></span></strong></p>
   <div class="example-contents">
    <div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$locale </span><span style="color: #007700">= </span><span style="color: #0000BB">locale_accept_from_http</span><span style="color: #007700">(</span><span style="color: #0000BB">$_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'HTTP_ACCEPT_LANGUAGE'</span><span style="color: #007700">]);<br />echo </span><span style="color: #0000BB">$locale</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
  <div class="example" id="example-2">
   <p><strong>Exemplo #2 Exemplo OO</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$locale </span><span style="color: #007700">= </span><span style="color: #0000BB">Locale</span><span style="color: #007700">::</span><span style="color: #0000BB">acceptFromHttp</span><span style="color: #007700">(</span><span style="color: #0000BB">$_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'HTTP_ACCEPT_LANGUAGE'</span><span style="color: #007700">]);<br />echo </span><span style="color: #0000BB">$locale</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
  <p class="para">O exemplo acima produzirá:</p>
  <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">en_US</pre>
</div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-locale.acceptfromhttp-seealso">
  <h3 class="title">Veja Também</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="locale.lookup.php" class="function" rel="rdfs-seeAlso">locale_lookup()</a> - Pesquisa a lista de etiquetas de l&iacute;ngua pela melhor correspond&ecirc;ncia &agrave; l&iacute;ngua</span></li>
   </ul>
  </p>
 </div>

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