<?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 => 'en',
  ),
  '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">Gets line from file and strip HTML tags</span></p>

 </div>

 <div id="splfileobject.fgetss-refsynopsisdiv">
   <div class="warning"><strong class="warning">Warning</strong><p class="simpara">This function has been
<em>DEPRECATED</em> as of PHP 7.3.0, and <em>REMOVED</em> as of PHP 8.0.0. Relying on this function
is highly discouraged.</p></div>
 </div>

 <div class="refsect1 description" id="refsect1-splfileobject.fgetss-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">function</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">
   Identical to <span class="methodname"><a href="splfileobject.fgets.php" class="methodname">SplFileObject::fgets()</a></span>, except that
   <span class="methodname"><strong>SplFileObject::fgetss()</strong></span> attempts to strip any HTML and PHP tags from
   the text it reads.
   The function retains the parsing state from call to call, and as such is not
   equivalent to calling <span class="function"><a href="function.strip-tags.php" class="function">strip_tags()</a></span> on the return value of
   <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">Parameters</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">allowable_tags</code></dt>
     <dd>
      <p class="para">
       Optional parameter to specify tags which should not be stripped. 
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-splfileobject.fgetss-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns a string containing the next line of the file with HTML and PHP
   code stripped, or <strong><code>false</code></strong> on error.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-splfileobject.fgetss-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 <span class="methodname"><strong>SplFileObject::fgetss()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php
$str </span><span style="color: #007700">= &lt;&lt;&lt;EOD
</span><span style="color: #DD0000">&lt;html&gt;&lt;body&gt;
 &lt;p&gt;Welcome! Today is the &lt;?php echo(date('jS')); ?&gt; of &lt;?= date('F'); ?&gt;.&lt;/p&gt;
&lt;/body&gt;&lt;/html&gt;
Text outside of the HTML block.
</span><span style="color: #007700">EOD;
</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">);

</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">);
while (!</span><span style="color: #0000BB">$file</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">eof</span><span style="color: #007700">()) {
    echo </span><span style="color: #0000BB">$file</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">fgetss</span><span style="color: #007700">();
}
</span><span style="color: #0000BB">?&gt;</span></code></pre></div>
    </div>

    <div class="example-contents"><p>The above example will output
something similar to:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">Welcome! Today is the  of .

Text outside of the HTML block.</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-splfileobject.fgetss-seealso">
  <h3 class="title">See Also</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>The <a href="" class="link">string.strip_tags</a> filter</li>
   </ul>
  </p>
 </div>


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