<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.radius.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'pt_BR',
  ),
  'this' => 
  array (
    0 => 'function.radius-get-attr.php',
    1 => 'radius_get_attr',
    2 => 'Extrai um atributo',
  ),
  'up' => 
  array (
    0 => 'ref.radius.php',
    1 => 'Fun&ccedil;&otilde;es de Radius',
  ),
  'prev' => 
  array (
    0 => 'function.radius-demangle-mppe-key.php',
    1 => 'radius_demangle_mppe_key',
  ),
  'next' => 
  array (
    0 => 'function.radius-get-tagged-attr-data.php',
    1 => 'radius_get_tagged_attr_data',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'pt_BR',
    'path' => 'reference/radius/functions/radius-get-attr.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.radius-get-attr" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">radius_get_attr</h1>
  <p class="verinfo">(PECL radius &gt;= 1.1.0)</p><p class="refpurpose"><span class="refname">radius_get_attr</span> &mdash; <span class="dc-title">Extrai um atributo</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.radius-get-attr-description">
  <h3 class="title">Descrição</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>radius_get_attr</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$radius_handle</code></span>): <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span></div>

  <p class="simpara">
   Assim como as requisições Radius, cada resposta pode conter zero ou mais atributos.
   Após uma resposta ser recebida com sucesso por
   <span class="function"><a href="function.radius-send-request.php" class="function">radius_send_request()</a></span>, seus atributos podem ser extraídos
   um por um usando <span class="function"><strong>radius_get_attr()</strong></span>. Cada vez que
   <span class="function"><strong>radius_get_attr()</strong></span> é chamada, ela obtém o próximo atributo
   da resposta atual.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.radius-get-attr-parameters">
  <h3 class="title">Parâmetros</h3>
  <dl>
   <dt><code class="parameter">radius_handle</code></dt><dd><p class="para">O resource RADIUS.</p></dd>
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.radius-get-attr-returnvalues">
  <h3 class="title">Valor Retornado</h3>
  <p class="simpara">
   Retorna um array associativo contendo o tipo de atributo e os dados, ou
   número de erro &lt;= 0.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.radius-get-attr-examples">
  <h3 class="title">Exemplos</h3>
  <div class="example" id="example-1">
   <p><strong>Exemplo #1 Exemplo de <span class="function"><strong>radius_get_attr()</strong></span></strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">while (</span><span style="color: #0000BB">$resa </span><span style="color: #007700">= </span><span style="color: #0000BB">radius_get_attr</span><span style="color: #007700">(</span><span style="color: #0000BB">$res</span><span style="color: #007700">)) {<br /><br />    if (!</span><span style="color: #0000BB">is_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$resa</span><span style="color: #007700">)) {<br />        </span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"Erro ao obter atributo: %s\n"</span><span style="color: #007700">,  </span><span style="color: #0000BB">radius_strerror</span><span style="color: #007700">(</span><span style="color: #0000BB">$res</span><span style="color: #007700">));<br />        exit;<br />    }<br /><br />    </span><span style="color: #0000BB">$attr </span><span style="color: #007700">= </span><span style="color: #0000BB">$resa</span><span style="color: #007700">[</span><span style="color: #DD0000">'attr'</span><span style="color: #007700">];<br />    </span><span style="color: #0000BB">$data </span><span style="color: #007700">= </span><span style="color: #0000BB">$resa</span><span style="color: #007700">[</span><span style="color: #DD0000">'data'</span><span style="color: #007700">];<br />    </span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"Obtido atributo:%d %d Bytes %s\n"</span><span style="color: #007700">, </span><span style="color: #0000BB">$attr</span><span style="color: #007700">, </span><span style="color: #0000BB">strlen</span><span style="color: #007700">(</span><span style="color: #0000BB">$data</span><span style="color: #007700">), </span><span style="color: #0000BB">bin2hex</span><span style="color: #007700">(</span><span style="color: #0000BB">$data</span><span style="color: #007700">));<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.radius-get-attr-seealso">
  <h3 class="title">Veja Também</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.radius-put-attr.php" class="function" rel="rdfs-seeAlso">radius_put_attr()</a> - Anexa um atributo bin&aacute;rio</span></li>
   <li><span class="function"><a href="function.radius-get-vendor-attr.php" class="function" rel="rdfs-seeAlso">radius_get_vendor_attr()</a> - Extrai um atributo espec&iacute;fico de fornecedor</span></li>
   <li><span class="function"><a href="function.radius-put-vendor-attr.php" class="function" rel="rdfs-seeAlso">radius_put_vendor_attr()</a> - Anexa um atributo bin&aacute;rio espec&iacute;fico de fornecedor</span></li>
   <li><span class="function"><a href="function.radius-send-request.php" class="function" rel="rdfs-seeAlso">radius_send_request()</a> - Envia a solicita&ccedil;&atilde;o e aguarda uma resposta</span></li>
  </ul>
 </div>

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