<?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.fgetc.php',
    1 => 'fgetc',
    2 => 'Liest das Zeichen, auf welches der Dateizeiger zeigt',
  ),
  'up' => 
  array (
    0 => 'ref.filesystem.php',
    1 => 'Dateisystem',
  ),
  'prev' => 
  array (
    0 => 'function.fflush.php',
    1 => 'fflush',
  ),
  'next' => 
  array (
    0 => 'function.fgetcsv.php',
    1 => 'fgetcsv',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/filesystem/functions/fgetc.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.fgetc" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">fgetc</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">fgetc</span> &mdash; <span class="dc-title">Liest das Zeichen, auf welches der Dateizeiger zeigt</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.fgetc-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>fgetc</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$stream</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">
   Liest ein Zeichen von dem übergebenen Dateizeiger.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.fgetc-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">stream</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>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.fgetc-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Gibt einen String zurück, welcher ein einzelnes Zeichen von der aktuellen
   Position des Dateizeigers <code class="parameter">stream</code> enthält. Gibt
   <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> zurück, wenn der Dateizeiger am Ende der Datei steht (EOF).
  </p>
  <div class="warning"><strong class="warning">Warnung</strong><p class="simpara">Diese Funktion kann sowohl das
boolsche <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> zurückliefern, als auch einen nicht-boolschen Wert, welcher zu <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> ausgewertet wird.
Weitere Informationen entnehmen Sie bitte dem Abschnitt über die
<a href="language.types.boolean.php" class="link"> boolschen Typen</a>. Benutzen Sie deshalb
<a href="language.operators.comparison.php" class="link">den === Operator</a>,
um den Rückgabewert dieser Funktion zu überprüfen.</p></div>
 </div>


 <div class="refsect1 examples" id="refsect1-function.fgetc-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 Ein <span class="function"><strong>fgetc()</strong></span>-Beispiel</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$fp </span><span style="color: #007700">= </span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #DD0000">'somefile.txt'</span><span style="color: #007700">, </span><span style="color: #DD0000">'r'</span><span style="color: #007700">);<br />if (!</span><span style="color: #0000BB">$fp</span><span style="color: #007700">) {<br />    echo </span><span style="color: #DD0000">'Konnte Datei somefile.txt nicht öffnen'</span><span style="color: #007700">;<br />}<br />while (</span><span style="color: #0000BB">false </span><span style="color: #007700">!== (</span><span style="color: #0000BB">$char </span><span style="color: #007700">= </span><span style="color: #0000BB">fgetc</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">))) {<br />    echo </span><span style="color: #DD0000">"</span><span style="color: #0000BB">$char</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.fgetc-notes">
  <h3 class="title">Anmerkungen</h3>
  <blockquote class="note"><p><strong class="note">Hinweis</strong>: <span class="simpara">Diese Funktion ist
binärsicher.</span></p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.fgetc-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.fread.php" class="function" rel="rdfs-seeAlso">fread()</a> - Liest Bin&auml;rdaten aus einer Datei</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.fgets.php" class="function" rel="rdfs-seeAlso">fgets()</a> - Liest die Zeile von der Position des Dateizeigers</span></li>
   </ul>
  </p>
 </div>


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