<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.filesystem.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.fgetss.php',
    1 => 'fgetss',
    2 => 'Liest eine Zeile von der Position des Dateizeigers und entfernt HTML Tags.',
  ),
  'up' => 
  array (
    0 => 'ref.filesystem.php',
    1 => 'Dateisystem',
  ),
  'prev' => 
  array (
    0 => 'function.fgets.php',
    1 => 'fgets',
  ),
  'next' => 
  array (
    0 => 'function.file.php',
    1 => 'file',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/filesystem/functions/fgetss.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.fgetss" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">fgetss</h1>
    <p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">fgetss</span> &mdash; <span class="dc-title">
     Liest eine Zeile von der Position des Dateizeigers und entfernt HTML Tags.
    </span></p>

   </div>

   <div id="function.fgetss-refsynopsisdiv">
    <div class="warning"><strong class="warning">Warnung</strong><p class="simpara">Diese Funktion ist seit
PHP 7.3.0 als <em>DEPRECATED</em> (veraltet) markiert und wurde in PHP 8.0.0
<em>ENTFERNT</em>. Von der Verwendung dieser Funktion wird
dringend abgeraten.</p></div>
   </div>

   <div class="refsect1 description" id="refsect1-function.fgetss-description">
    <h3 class="title">Beschreibung</h3>
     <div class="methodsynopsis dc-description">
      <span class="methodname"><strong>fgetss</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$handle</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$length</code><span class="initializer"> = ?</span></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">
     Diese Funktion ist identisch mit der Funktion
     <span class="function"><a href="function.fgets.php" class="function">fgets()</a></span>, außer dass
     <span class="function"><strong>fgetss()</strong></span> versucht, vorhandene NUL-Bytes sowie HTML und
     PHP-Tags aus dem gelesenen Text zu entfernen.
     Die Funktion erhält den Parse-Zustand von Aufruf zu Aufruf, und ist daher nicht
     gleichwertig zum Aufruf von <span class="function"><a href="function.strip-tags.php" class="function">strip_tags()</a></span> auf den Rückgabewert
     von <span class="function"><a href="function.fgets.php" class="function">fgets()</a></span>.
    </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.fgetss-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">handle</code></dt>
     <dd>
      <p class="para">Der Zeiger auf eine Datei muss gültig sein und
auf eine Datei verweisen, die vorher erfolgreich mit <span class="function"><a href="function.fopen.php" class="function">fopen()</a></span>
oder <span class="function"><a href="function.fsockopen.php" class="function">fsockopen()</a></span> geöffnet (und nicht bereits von
<span class="function"><a href="function.fclose.php" class="function">fclose()</a></span> geschlossen) wurde.</p>
     </dd>
    
    
     <dt><code class="parameter">length</code></dt>
     <dd>
      <p class="para">
       Länge der zu lesende Eingabe.
      </p>
     </dd>
    
    
     <dt><code class="parameter">allowable_tags</code></dt>
     <dd>
      <p class="para">
       Über den optionalen dritten Parameter können Tags angegeben
       werden die nicht entfernt werden sollen.
       Siehe <span class="function"><a href="function.strip-tags.php" class="function">strip_tags()</a></span> zu Details bezüglich
       <code class="parameter">allowable_tags</code>.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.fgetss-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Returns a string of up to <code class="parameter">length</code> - 1 bytes read from
   the file pointed to by <code class="parameter">handle</code>, with all HTML and PHP
   code striped.
  </p>
  <p class="para">
   Falls ein Fehler auftritt wird <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> zurückgegeben.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.fgetss-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 Reading a PHP file line-by-line</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;Welcome! Today is the &lt;?php echo(date('jS')); ?&gt; of &lt;?= date('F'); ?&gt;.&lt;/p&gt;<br />&lt;/body&gt;&lt;/html&gt;<br />Text outside of the HTML block.<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">$handle </span><span style="color: #007700">= @</span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #DD0000">"sample.php"</span><span style="color: #007700">, </span><span style="color: #DD0000">"r"</span><span style="color: #007700">);<br />if (</span><span style="color: #0000BB">$handle</span><span style="color: #007700">) {<br />  while (!</span><span style="color: #0000BB">feof</span><span style="color: #007700">(</span><span style="color: #0000BB">$handle</span><span style="color: #007700">)) {<br />    </span><span style="color: #0000BB">$buffer </span><span style="color: #007700">= </span><span style="color: #0000BB">fgetss</span><span style="color: #007700">(</span><span style="color: #0000BB">$handle</span><span style="color: #007700">, </span><span style="color: #0000BB">4096</span><span style="color: #007700">);<br />    echo </span><span style="color: #0000BB">$buffer</span><span style="color: #007700">;<br />  }<br />  </span><span style="color: #0000BB">fclose</span><span style="color: #007700">(</span><span style="color: #0000BB">$handle</span><span style="color: #007700">);<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>Das oben gezeigte Beispiel erzeugt
eine ähnliche Ausgabe wie:</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 notes" id="refsect1-function.fgetss-notes">
  <h3 class="title">Anmerkungen</h3>
  <blockquote class="note"><p><strong class="note">Hinweis</strong>: <span class="simpara">Wenn PHP Zeilenendezeichen
nicht richtig erkennt, entweder beim Lesen von Dateien auf einem Macintosh oder
bei Dateien, die auf einem Macintosh erstellt wurden, kann die Option
<a href="filesystem.configuration.php#ini.auto-detect-line-endings" class="link">auto_detect_line_endings</a>
aktiviert werden.</span></p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.fgetss-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.fgets.php" class="function" rel="rdfs-seeAlso">fgets()</a> - Liest die Zeile von der Position des Dateizeigers</span></li>
    <li><span class="function"><a href="function.fopen.php" class="function" rel="rdfs-seeAlso">fopen()</a> - &Ouml;ffnet eine Datei oder URL</span></li>
    <li><span class="function"><a href="function.popen.php" class="function" rel="rdfs-seeAlso">popen()</a> - &Ouml;ffnet einen Dateizeiger f&uuml;r einen Prozess</span></li>
    <li><span class="function"><a href="function.fsockopen.php" class="function" rel="rdfs-seeAlso">fsockopen()</a> - Stellt eine Internet- oder Unix-Domain-Socket-Verbindung her</span></li>
    <li><span class="function"><a href="function.strip-tags.php" class="function" rel="rdfs-seeAlso">strip_tags()</a> - Entfernt HTML- und PHP-Tags aus einem String</span></li>
    <li><span class="methodname"><a href="splfileobject.fgetss.php" class="methodname" rel="rdfs-seeAlso">SplFileObject::fgetss()</a> - Gets line from file and strip HTML tags</span></li>
    <li>Den <a href="filters.string.php#filters.string.strip_tags" class="link">string.strip_tags</a> Filter</li>
   </ul>
  </p>
 </div>


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