cvs: phpdoc-hu /reference/filesystem/functions file.xml
[email protected] ("Lajos Cseppent?")
| Newsgroups | php.doc.hu |
|---|---|
| Message-ID | <cvschappy1170169409@cvsserver> |
chappy Tue Jan 30 15:03:29 2007 UTC
Added files:
/phpdoc-hu/reference/filesystem/functions file.xml
Log:
sync
http://cvs.php.net/viewvc.cgi/phpdoc-hu/reference/filesystem/functions/file.xml?view=markup&rev=1.1
Index: phpdoc-hu/reference/filesystem/functions/file.xml
+++ phpdoc-hu/reference/filesystem/functions/file.xml
<?xml version="1.0" encoding="iso-8859-2"?>
<!-- EN-Revision: 1.19 Maintainer: chappy Status: ready -->
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
<refentry id="function.file">
<refnamediv>
<refname>file</refname>
<refpurpose>Egy teljes fájlt tömbbe olvas</refpurpose>
</refnamediv>
<refsect1>
<title>Leírás</title>
<methodsynopsis>
<type>array</type><methodname>file</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>use_include_path</parameter></methodparam>
<methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam>
</methodsynopsis>
<para>
Ugyanaz, mint a <function>file_get_contents</function> függvény, kivéve azt, hogy a
<function>file</function> függvény a fájlt tömbben adja vissza. Minden eleme a
tömbnek megegyezik a fájl soraival,
egy új sort még mindig hozzákapcsolva. Hiba esetén a <function>file</function> függvény
&false;-szal tér vissza.
</para>
<para>
Használhatod az opcinális <parameter>use_include_path</parameter> paramétert és
beállíthatod az értékét "1"-re, ha szeretnéd, hogy a PHP az <link
linkend="ini.include-path">include_path</link>-ban is keresse a fájlt.
</para>
<para>
<informalexample>
<programlisting role="php">
<![CDATA[
<?php
// Fájl kinyerése tömbbe. Ebben a példában HTTP-n
// keresztül nyerjük ki az URL forrás segítségével a HTML tartalmat.
$lines = file('http://www.example.com/');
// Járjuk körbe a tömböt, írassuk ki a HTML forrást HTML forrásként sorszámozással
foreach ($lines as $line_num => $line) {
echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br />\n";
}
// Másik példa, weblap kinyerése karakterláncba. Lásd még: file_get_contents().
$html = implode('', file('http://www.example.com/'));
?>
]]>
</programlisting>
</informalexample>
</para>
&tip.fopen-wrapper;
<note>
<para>
Ez eredmény tömbben az összes sor tartalmazza a sorvégzõdést, tehát
szükséged van <function>rtrim</function> függvényre, ha nem szeretnéd, hogy a
sorvégzõdés jelen legyen.
</para>
</note>
¬e.line-endings;
<note>
<para>
A PHP 4.3.0-tõl használhatod a <function>file_get_contents</function> függvényt,
hogy a fájl tartalmát karakterlánckénet kapd vissza.
</para>
<para>
PHP 4.3.0-tól a <function>file</function> függvény binary safe.
</para>
</note>
¬e.context-support;
&warn.ssl-non-standard;
<para>
Lásd még: <function>readfile</function>,
<function>fopen</function>, <function>fsockopen</function>,
<function>popen</function>, <function>file_get_contents</function>,
<function>include</function>, és
<function>stream_context_create</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
-->