<?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 => 'it',
  ),
  'this' => 
  array (
    0 => 'splfileobject.current.php',
    1 => 'SplFileObject::current',
    2 => 'Retrieve current line of file',
  ),
  'up' => 
  array (
    0 => 'class.splfileobject.php',
    1 => 'SplFileObject',
  ),
  'prev' => 
  array (
    0 => 'splfileobject.construct.php',
    1 => 'SplFileObject::__construct',
  ),
  'next' => 
  array (
    0 => 'splfileobject.eof.php',
    1 => 'SplFileObject::eof',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/spl/splfileobject/current.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="splfileobject.current" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">SplFileObject::current</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">SplFileObject::current</span> &mdash; <span class="dc-title">Retrieve current line of file</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-splfileobject.current-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>SplFileObject::current</strong></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.array.php" class="type array">array</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Retrieves the current line of the file.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-splfileobject.current-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <p class="para">Questa funzione non contiene parametri.</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-splfileobject.current-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="para">
   Retrieves the current line of the file. If the <strong><code><a href="class.splfileobject.php#splfileobject.constants.read-csv">SplFileObject::READ_CSV</a></code></strong> flag is set, this method returns an array containing the current line parsed as CSV data.
   If the end of the file is reached, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> is returned.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-splfileobject.current-examples">
  <h3 class="title">Esempi</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 <span class="methodname"><strong>SplFileObject::current()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$file </span><span style="color: #007700">= new </span><span style="color: #0000BB">SplFileObject</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">);<br />foreach (</span><span style="color: #0000BB">$file </span><span style="color: #007700">as </span><span style="color: #0000BB">$k </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$line</span><span style="color: #007700">) {<br />   echo (</span><span style="color: #0000BB">$file</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">key</span><span style="color: #007700">() + </span><span style="color: #0000BB">1</span><span style="color: #007700">) . </span><span style="color: #DD0000">': ' </span><span style="color: #007700">. </span><span style="color: #0000BB">$file</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">current</span><span style="color: #007700">();<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>Il precedente esempio visualizzerà
qualcosa simile a:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">1: &lt;?php
2: $file = new SplFileObject(__FILE__);
3: foreach ($file as $line) {
4:     echo ($file-&gt;key() + 1) . &#039;: &#039; . $file-&gt;current();
5: }
6: ?&gt;</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-splfileobject.current-seealso">
  <h3 class="title">Vedere anche:</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="splfileobject.key.php" class="methodname" rel="rdfs-seeAlso">SplFileObject::key()</a> - Get line number</span></li>
    <li><span class="methodname"><a href="splfileobject.seek.php" class="methodname" rel="rdfs-seeAlso">SplFileObject::seek()</a> - Seek to specified line</span></li>
    <li><span class="methodname"><a href="splfileobject.next.php" class="methodname" rel="rdfs-seeAlso">SplFileObject::next()</a> - Read next line</span></li>
    <li><span class="methodname"><a href="splfileobject.rewind.php" class="methodname" rel="rdfs-seeAlso">SplFileObject::rewind()</a> - Rewind the file to the first line</span></li>
    <li><span class="methodname"><a href="splfileobject.valid.php" class="methodname" rel="rdfs-seeAlso">SplFileObject::valid()</a> - Not at EOF</span></li>
   </ul>
  </p>
 </div>


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