<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.splfileobject.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'pt_BR',
  ),
  'this' => 
  array (
    0 => 'splfileobject.fgetss.php',
    1 => 'SplFileObject::fgetss',
    2 => 'Obt&eacute;m linha do arquivo e remove tags HTML',
  ),
  'up' => 
  array (
    0 => 'class.splfileobject.php',
    1 => 'SplFileObject',
  ),
  'prev' => 
  array (
    0 => 'splfileobject.fgets.php',
    1 => 'SplFileObject::fgets',
  ),
  'next' => 
  array (
    0 => 'splfileobject.flock.php',
    1 => 'SplFileObject::flock',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'pt_BR',
    'path' => 'reference/spl/splfileobject/fgetss.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="splfileobject.fgetss" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">SplFileObject::fgetss</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.0, PHP 7)</p><p class="refpurpose"><span class="refname">SplFileObject::fgetss</span> &mdash; <span class="dc-title">Obtém linha do arquivo e remove tags HTML</span></p>

 </div>

 <div id="splfileobject.fgetss-refsynopsisdiv">
   <div class="warning"><strong class="warning">Aviso</strong><p class="simpara">Esta função foi
<em>DESCONTINUADA</em> a partir do PHP 7.3.0 e foi <em>REMOVIDA</em> a partir do PHP 8.0.0. O uso desta função
é fortemente desencorajado.</p></div>
 </div>

 <div class="refsect1 description" id="refsect1-splfileobject.fgetss-description">
  <h3 class="title">Descrição</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>SplFileObject::fgetss</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$allowable_tags</code><span class="initializer"> = ?</span></span>): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>

  <p class="para rdfs-comment">
   Idêntico ao <span class="methodname"><a href="splfileobject.fgets.php" class="methodname">SplFileObject::fgets()</a></span>, exceto que
   <span class="methodname"><strong>SplFileObject::fgetss()</strong></span> tenta remover quaisquer tags HTML e PHP do
   texto que lê.
   A função mantém o estado de análise de chamada para chamada, e como tal não é
   equivalente a chamar <span class="function"><a href="function.strip-tags.php" class="function">strip_tags()</a></span> no valor de retorno de
   <span class="methodname"><a href="splfileobject.fgets.php" class="methodname">SplFileObject::fgets()</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-splfileobject.fgetss-parameters">
  <h3 class="title">Parâmetros</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">allowable_tags</code></dt>
     <dd>
      <p class="para">
       Parâmetro opcional para especificar tags que não devem ser removidas.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-splfileobject.fgetss-returnvalues">
  <h3 class="title">Valor Retornado</h3>
  <p class="para">
   Retorna uma string contendo a próxima linha do arquivo com código HTML e PHP
   removido, ou <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> em caso de erro.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-splfileobject.fgetss-examples">
  <h3 class="title">Exemplos</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemplo #1 Exemplo de <span class="methodname"><strong>SplFileObject::fgetss()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$str </span><span style="color: #007700">= &lt;&lt;&lt;EOD<br /></span><span style="color: #DD0000">&lt;html&gt;&lt;body&gt;<br /> &lt;p&gt;Bem-vindo! Hoje é o &lt;?php echo(date('jS')); ?&gt; de &lt;?= date('F'); ?&gt;.&lt;/p&gt;<br />&lt;/body&gt;&lt;/html&gt;<br />Texto fora do bloco HTML.<br /></span><span style="color: #007700">EOD;<br /></span><span style="color: #0000BB">file_put_contents</span><span style="color: #007700">(</span><span style="color: #DD0000">"sample.php"</span><span style="color: #007700">, </span><span style="color: #0000BB">$str</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$file </span><span style="color: #007700">= new </span><span style="color: #0000BB">SplFileObject</span><span style="color: #007700">(</span><span style="color: #DD0000">"sample.php"</span><span style="color: #007700">);<br />while (!</span><span style="color: #0000BB">$file</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">eof</span><span style="color: #007700">()) {<br />    echo </span><span style="color: #0000BB">$file</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">fgetss</span><span style="color: #007700">();<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>O exemplo acima produzirá
algo semelhante a:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">Bem-vindo! Hoje é o  de .

Texto fora do bloco HTML.</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-splfileobject.fgetss-seealso">
  <h3 class="title">Veja Também</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.fgetss.php" class="function" rel="rdfs-seeAlso">fgetss()</a> - Ler uma linha de um ponteiro de arquivo e retira as tags HTML</span></li>
    <li><span class="methodname"><a href="splfileobject.fgets.php" class="methodname" rel="rdfs-seeAlso">SplFileObject::fgets()</a> - Obt&eacute;m linha do arquivo</span></li>
    <li><span class="methodname"><a href="splfileobject.fgetc.php" class="methodname" rel="rdfs-seeAlso">SplFileObject::fgetc()</a> - Obt&eacute;m caractere do arquivo</span></li>
    <li><span class="methodname"><a href="splfileobject.current.php" class="methodname" rel="rdfs-seeAlso">SplFileObject::current()</a> - Recupera linha atual do arquivo</span></li>
    <li>O filtro <a href="filters.string.php#filters.string.strip_tags" class="link">string.strip_tags</a></li>
   </ul>
  </p>
 </div>


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