cvs: phpdoc-hu /reference/filesystem/functions fgetcsv.xml

[email protected] ("Lajos Cseppent?")
Newsgroups php.doc.hu
Message-ID <cvschappy1170438070@cvsserver>
chappy		Fri Feb  2 17:41:10 2007 UTC

  Added files:                 
    /phpdoc-hu/reference/filesystem/functions	fgetcsv.xml 
  Log:
  sync
  

http://cvs.php.net/viewvc.cgi/phpdoc-hu/reference/filesystem/functions/fgetcsv.xml?view=markup&rev=1.1
Index: phpdoc-hu/reference/filesystem/functions/fgetcsv.xml
+++ phpdoc-hu/reference/filesystem/functions/fgetcsv.xml
<?xml version="1.0" encoding="iso-8859-2"?>
<!-- EN-Revision: 1.20 Maintainer: chappy Status: ready -->
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
  <refentry id="function.fgetcsv">
   <refnamediv>
    <refname>fgetcsv</refname>
    <refpurpose>Kinyer egy sort a fájl pointerbõl és elemzi a CSV mezõket</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Leírás</title>
     <methodsynopsis>
      <type>array</type><methodname>fgetcsv</methodname>
      <methodparam><type>resource</type><parameter>handle</parameter></methodparam>
      <methodparam choice="opt"><type>int</type><parameter>length</parameter></methodparam>
      <methodparam choice="opt"><type>string</type><parameter>delimiter</parameter></methodparam>
      <methodparam choice="opt"><type>string</type><parameter>enclosure</parameter></methodparam>
     </methodsynopsis>

    <para>
     <variablelist>
      <varlistentry>
       <term><parameter>handle</parameter></term>
       <listitem>
        <simpara>
         Egy valódi fájl pointer, amit sikereseren nyitottak meg az <function>fopen</function>,
         <function>popen</function> vagy <function>fsockopen</function> függvénnyel.
        </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term><parameter>length</parameter> (Opcinális)</term>
       <listitem>
        <simpara>
         Nagyobbnak kell lennie a leghosszabb sor hosszánál (karakterek számában), ami megtalálható a CVS fájlban
         (sorvégi karaktereket figyelembe véve). A PHP 5-ben opcinálissá vált. Ezt a paramétert kihagyva 
		 (vagy 0-ra állítva PHP 5.0.4-tõl) a legnagyobb sorhosszúság nem lesz korlátozva,
         ami feltûnõen lassabb.
        </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term><parameter>delimiter</parameter> (Opcinális)</term>
       <listitem>
        <simpara>
         Beállítja a mezõelválasztó karaktert (csak egy karakter). Alapértelmezettként ez vesszó (,).
        </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term><parameter>enclosure</parameter> (Opcinális)</term>
       <listitem>
        <simpara>
         Beállítja a mezõhatároló karaktert (csak egy karakter). Alapértelmezettként idézõjel ("). A PHP 4.3.0-ban került a nyelvbe.
        </simpara>
       </listitem>
      </varlistentry>
     </variablelist>
    </para>

    <simpara>
     Hasonló a <function>fgets</function> függvényhez, kivéve azt, hogy a
     <function>fgetcsv</function> parses the line it reads for fields
     in <acronym>CSV</acronym> format and returns an array containing
     the fields read.
    </simpara>
    <simpara>
     A <function>fgetcsv</function> függvény &false;-szal tér vissza hiba esetén, akkor is, ha a 
     fájl végén van.
    </simpara>
    <note>
     <simpara>
      A CSV fájlban szereplõ üres sorokat is beolvassa és így a kapott tömbben ehhez a sorhoz tartozó mezõnek
	  az értéke <type>null</type> lesz, és a PHP nem jelez 
	  hibát.
     </simpara>
    </note>
    <para>
     <example>
      <title>Egy teljes CSV fájl tartalmának beolvasása és kiírása</title>
      <programlisting role="php">
<![CDATA[
<?php
$row = 1;
$handle = fopen("test.csv", "r");
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
    $num = count($data);
    echo "<p> $num fields in line $row: <br /></p>\n";
    $row++;
    for ($c=0; $c < $num; $c++) {
        echo $data[$c] . "<br />\n";
    }
}
fclose($handle);
?>
]]>
      </programlisting>
     </example>
    </para>
    <para>
     A <function>fgetcsv</function> függvény binary safe a PHP 4.3.5 óta.
    </para>
    <note>
     <simpara>
      A helyi beállítás (locale setting) ha a függvény mûködésére. Ha a 
      <varname>LANG</varname> értéke pl.: <literal>en_US.UTF-8</literal>, az 
      egy-bájt kódolású fájlokat rosszul fogja ez a függvény beolvasni.
     </simpara>
    </note>
    &note.line-endings;
    <para>
     Lásd még: <function>explode</function>, <function>file</function>, 
     <function>pack</function> és <function>fputcsv</function>.
    </para>
   </refsect1>
  </refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.