cvs: phpdoc-zh /reference/filesystem/functions fgetcsv.xml fgets.xml fgetss.xml file-exists.xml file-get-contents.xml file-get-wrapper-data.xml
file-register-wrapper.xml file.xml
| From: | Dallas Thunder | Date: | Thu, 26 Sep 2002 07:51:00 +0000 |
| Subject: | cvs: phpdoc-zh /reference/filesystem/functions fgetcsv.xml fgets.xml fgetss.xml file-exists.xml file-get-contents.xml file-get-wrapper-data.xml file-register-wrapper.xml file.xml |
||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-636@lists.php.net to get a copy of this message | ||
dallas Thu Sep 26 03:51:00 2002 EDT
Added files:
/phpdoc-zh/reference/filesystem/functions fgetcsv.xml fgetss.xml
fgets.xml file-exists.xml
file-get-contents.xml
file-get-wrapper-data.xml
file.xml
file-register-wrapper.xml
Log:
Translation completed.
Index: phpdoc-zh/reference/filesystem/functions/fgetcsv.xml +++ phpdoc-zh/reference/filesystem/functions/fgetcsv.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> <refentry id="function.fgetcsv"> <refnamediv> <refname>fgetcsv</refname> <refpurpose>´ÓÎļþÖ¸ÕëÖжÁÈëÒ»Ðв¢½âÎö CSV ×Ö¶Î</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>array</type><methodname>fgetcsv</methodname> <methodparam><type>int</type><parameter>fp</parameter></methodparam> <methodparam><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> <simpara> ºÍ <function>fgets</function> ÀàËÆ£¬Ö»³ýÁË <function>fgetcsv</function> ½âÎö¶ÁÈëµÄÐв¢ÕÒ³ö <acronym>CSV</acronym> ¸ñʽµÄ×Ö¶ÎÈ»ºó·µ»ØÒ»¸ö°üº¬ÕâЩ×ֶεÄÊý×é¡£×ֶηָô·ûÊǶººÅ£¬»òÕßÓÿÉÑ¡µÄµÚÈý¸ö²ÎÊýÁíÍâÖ¸¶¨¡£×Ö¶ÎÓÃË«ÒýºÅ°üΧ£¬»òÕßÓÿÉÑ¡µÄµÚËĸö²ÎÊýÁíÍâÖ¸¶¨¡£<parameter>Delimiter</parameter> ºÍ <parameter>enclosure</parameter> ²»ÄÜÊÇ null ²¢ÇÒÖ»ÓеÚÒ»¸ö×Ö·ûÓÐЧ¡£ </simpara> <simpara> <parameter>fp</parameter> ±ØÐëÊÇͨ¹ý <function>fopen</function>£¬<function>popen</function> »òÕß <function>fsockopen</function> ³É¹¦´ò¿ªµÄÓÐЧÎļþÖ¸Õë¡£ </simpara> <simpara> <parameter>length</parameter> ±ØÐë´óÓÚ CVS ÎļþÖ㤶È×î´óµÄÐУ¨ÒÔ±ãÓÚ´¦ÀíÐнáÊø×Ö·û£©¡£ </simpara> <simpara> <function>fgetcsv</function> ³ö´íʱ·µ»Ø &false;£¬°üÀ¨Åöµ½Îļþ½áÊøÊ±¡£ </simpara> <note> <simpara> CSV ÎļþÖеĿÕÐн«±»·µ»ØÎªÒ»¸ö°üº¬Óе¥¸ö &null; ×ֶεÄÊý×飬²»»á±»µ±³É´íÎó¡£ </simpara> <simpara> <parameter>enclosure</parameter> ÊÇ PHP 4.3.0 мӵġ£ </simpara> </note> <example> <title> <function>fgetcsv</function> Àý×Ó - ¶ÁÈ¡²¢ÏÔʾ CSV ÎļþµÄÕû¸öÄÚÈÝ </title> <programlisting role="php"> <![CDATA[ $row = 1; $fp = fopen ("test.csv","r"); while ($data = fgetcsv ($fp, 1000, ",")) { $num = count ($data); print "<p> $num fields in line $row: <br>"; $row++; for ($c=0; $c < $num; $c++) { print $data[$c] . "<br>"; } } fclose ($fp); ]]> </programlisting> </example> </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 --> Index: phpdoc-zh/reference/filesystem/functions/fgetss.xml +++ phpdoc-zh/reference/filesystem/functions/fgetss.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="function.fgetss"> <refnamediv> <refname>fgetss</refname> <refpurpose>´ÓÎļþÖ¸ÕëÖжÁȡһÐв¢¹ýÂ˵ô HTML ±ê¼Ç</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>string</type><methodname>fgetss</methodname> <methodparam><type>int</type><parameter>fp</parameter></methodparam> <methodparam><type>int</type><parameter>length</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>allowable_tags</parameter></methodparam> </methodsynopsis> <para> ºÍ <function>fgets</function> Ïàͬ£¬Ö»³ýÁË fgetss ³¢ÊÔ´Ó¶ÁÈ¡µÄÎı¾ÖÐÈ¥µôÈκΠHTML ºÍ PHP ±ê¼Ç¡£ </para> <para> ¿ÉÒÔÓÿÉÑ¡µÄµÚÈý¸ö²ÎÊýÖ¸¶¨ÄÄЩ±ê¼Ç²»±»È¥µô¡£ <note> <para> <parameter>allowable_tags</parameter> ÊÇ PHP 3.0.13£¬PHP 4.0.0 мӵġ£ </para> </note> </para> <para> ²Î¼û <function>fgets</function>£¬<function>fopen</function>£¬<function>fsockopen</function>£¬<function>popen</function> ºÍ <function>strip_tags</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 --> Index: phpdoc-zh/reference/filesystem/functions/fgets.xml +++ phpdoc-zh/reference/filesystem/functions/fgets.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="function.fgets"> <refnamediv> <refname>fgets</refname> <refpurpose>´ÓÎļþÖ¸ÕëÖжÁȡһÐÐ</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>string</type><methodname>fgets</methodname> <methodparam><type>int</type><parameter>fp</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>length</parameter></methodparam> </methodsynopsis> <para> ´Ó fp Ö¸ÏòµÄÎļþÖжÁȡһÐв¢·µ»Ø³¤¶È×î¶àΪ length - 1 ×Ö½ÚµÄ×Ö·û´®¡£Åöµ½»»Ðзû£¨°üÀ¨ÔÚ·µ»ØÖµÖУ©¡¢EOF »òÕßÒѾ¶ÁÈ¡ÁË length - 1 ×Ö½ÚºóÍ£Ö¹£¨¿´ÏÈÅöµ½ÄÇÒ»ÖÖÇé¿ö£©¡£Èç¹ûûÓÐÖ¸¶¨ length£¬ÔòĬÈÏΪ 1K£¬»òÕß˵ 1024 ×Ö½Ú¡£ </para> <para> ³ö´íʱ·µ»Ø &false;¡£ </para> <para> ͨ³£µÄȱÏÝ£º </para> <simpara> ϰ¹ßÁË C ÓïÑÔÖÐ <function>fgets</function> Óï·¨µÄÈËÓ¦¸Ã×¢Òâµ½ <literal>EOF</literal> ÊÇÔõÑù±»·µ»ØµÄ¡£ </simpara> <simpara> ÎļþÖ¸Õë±ØÐëÓÐЧ£¬²¢ÇÒÊÇͨ¹ý <function>fopen</function> »ò <function>fsockopen</function> ³É¹¦´ò¿ªµÄ¡£ </simpara> <para> ÒÔÏÂÊÇÒ»¸ö¼òµ¥Àý×Ó£º <example> <title>ÖðÐжÁÈ¡Îļþ</title> <programlisting role="php"> <![CDATA[ $fd = fopen ("/tmp/inputfile.txt", "r"); while (!feof ($fd)) { $buffer = fgets($fd, 4096); echo $buffer; } fclose ($fd); ]]> </programlisting> </example> </para> <note> <simpara> <parameter>length</parameter> ²ÎÊý´Ó PHP 4.2.0 Æð³ÉΪ¿ÉÑ¡Ïî¡£ </simpara> </note> <para> ²Î¼û <function>fread</function>£¬<function>fopen</function>£¬<function>popen</function>£¬<function>fgetc</function>£¬<function>fsockopen</function> ºÍ <function>socket_set_timeout</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 --> Index: phpdoc-zh/reference/filesystem/functions/file-exists.xml +++ phpdoc-zh/reference/filesystem/functions/file-exists.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> <refentry id="function.file-exists"> <refnamediv> <refname>file_exists</refname> <refpurpose>¼ì²éÎļþÊÇ·ñ´æÔÚ</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>bool</type><methodname>file_exists</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> </methodsynopsis> <simpara> Èç¹ûÓÉ <parameter>filename</parameter> Ö¸¶¨µÄÎļþ´æÔÚÔò·µ»Ø &true;£¬·ñÔò·µ»Ø &false;¡£ </simpara> <simpara> ±¾º¯Êý²»ÄÜÓÃÓÚ<link linkend="features.remote-files">Ô¶³ÌÎļþ</link>£¬±»¼ì²éµÄÎļþ±ØÐëͨ¹ý·þÎñÆ÷µÄÎļþϵͳÀ´·ÃÎÊ¡£ </simpara> <simpara> ±¾º¯ÊýµÄ·µ»Ø½á¹û»á±»»º´æ¡£¸ü¶àÏêϸ×ÊÁϼû <function>clearstatcache</function>¡£ </simpara> <simpara> ÔÚ Windows ÖÐÒªÓà "//computername/share/filename" »òÕß "\\\\computername\share\filename" À´¼ì²éÍøÂçÖеĹ²ÏíÎļþ¡£ </simpara> </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 --> Index: phpdoc-zh/reference/filesystem/functions/file-get-contents.xml +++ phpdoc-zh/reference/filesystem/functions/file-get-contents.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> <refentry id="function.file-get-contents"> <refnamediv> <refname>file_get_contents</refname> <refpurpose>½«Õû¸öÎļþ¶ÁÈëÒ»¸ö×Ö·û´®</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>string</type><methodname>file_get_contents</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>use_include_path</parameter></methodparam> </methodsynopsis> <para> ºÍ <function>readfile</function> Ò»Ñù£¬Ö»³ýÁË <function>file_get_contents</function> ½«Îļþ·µ»ØÎªÒ»¸ö×Ö·û´®¡£ </para> ¬e.bin-safe; &tip.fopen-wrapper; <simpara> ²Î¼û <function>fgets</function>£¬<function>file</function>£¬<function>fread</function>£¬<function>include</function> ºÍ <function>readfile</function>¡£ </simpara> </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 --> Index: phpdoc-zh/reference/filesystem/functions/file-get-wrapper-data.xml +++ phpdoc-zh/reference/filesystem/functions/file-get-wrapper-data.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> <refentry id="function.file-get-wrapper-data"> <refnamediv> <refname>file_get_wrapper_data</refname> <refpurpose>´Ó·â×°ÐÒéÎļþÖ¸ÕëÖÐÈ¡µÃ±¨Í·£¯ÔªÊý¾Ý</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>mixed</type><methodname>file_get_wrapper_data</methodname> <methodparam><type>int</type><parameter>fp</parameter></methodparam> </methodsynopsis> <simpara> ±¾º¯Êý·µ»ØÍ¨¹ý <function>fopen</function> ´ò¿ªµÄÎļþµÄ±¨Í·»òÕßÔªÊý¾Ý¡£¿ÉÒÔÓÃÀ´·µ»Ø HTTP Á¬½ÓµÄÏìÓ¦±¨Í·£¬»òÕ߯äËü×ÊÔ´µÄͳ¼ÆÊý¾Ý¡£ </simpara> <simpara> ·µ»ØÊý¾ÝµÄ¸ñʽ¹ÊÒâ²»ÔÚ´ËʱÁÐÈëÎĵµ£¬²¢ÇÒ¸ù¾ÝʹÓÃÁËÄÄÖÖ·â×°ÐÒé¶ø²»Í¬¡£ </simpara> <note> <para> ±¾º¯ÊýÊÇ PHP 4.3.0 Òý½øµÄ¡£ </para> </note> </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 --> Index: phpdoc-zh/reference/filesystem/functions/file.xml +++ phpdoc-zh/reference/filesystem/functions/file.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="function.file"> <refnamediv> <refname>file</refname> <refpurpose>°ÑÕû¸öÎļþ¶ÁÈëÒ»¸öÊý×éÖÐ</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</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> </methodsynopsis> <para> ºÍ <function>readfile</function> Ò»Ñù£¬Ö»³ýÁË <function>file</function> ½«Îļþ×÷Ϊһ¸öÊý×é·µ»Ø¡£Êý×éÖеÄÿ¸öµ¥Ôª¶¼ÊÇÎļþÖÐÏàÓ¦µÄÒ»ÐУ¬°üÀ¨»»ÐзûÔÚÄÚ¡£ </para> <note> <para> ·µ»ØµÄÊý×éÖÐÿһÐж¼°üÀ¨ÁËÐнáÊø·û£¬Òò´ËÈç¹û²»ÐèÒªÐнáÊø·ûʱ»¹ÐèҪʹÓà <function>trim</function> º¯Êý¡£ </para> </note> <para> ¿ÉÒÔ½«¿ÉÑ¡µÄµÚ¶þ¸ö²ÎÊýÉèΪ "1"£¬Èç¹ûÒ²ÏëÔÚ <link linkend="ini.include-path">include_path</link> ÖÐËÑѰÎļþµÄ»°¡£ </para> <para> <informalexample> <programlisting role="php"> <![CDATA[ <?php // ½«Ò»¸ö web Ò³Ãæ¶ÁÈëµ½Ò»¸öÊý×éÖв¢Êä³ö $fcontents = file ('http://www.example.com/'); while (list ($line_num, $line) = each ($fcontents)) { echo "<b>Line $line_num:</b>; ", htmlspecialchars ($line), "<br>\n"; } // ½«Ò»¸ö web Ò³Ãæ¶ÁÈëµ½Ò»¸ö×Ö·û´® $fcontents = implode ('', file ('http://www.example.com/')); ?> ]]> </programlisting> </informalexample> </para> <note> <para> ´Ó PHP 4.3.0 ¿ªÊ¼¿ÉÒÔÓà <function>file_get_contents</function> À´½«Îļþ¶ÁÈëµ½Ò»¸ö×Ö·û´®·µ»Ø£¬¶þ½øÖÆÎļþÒ²¿ÉÒÔ¡£ </para> </note> ¬e.not-bin-safe; &tip.fopen-wrapper; <para> ²Î¼û <function>readfile</function>£¬<function>fopen</function>£¬<function>fsockopen</function> ºÍ <function>popen</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 --> Index: phpdoc-zh/reference/filesystem/functions/file-register-wrapper.xml +++ phpdoc-zh/reference/filesystem/functions/file-register-wrapper.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="function.file-register-wrapper"> <refnamediv> <refname>file_register_wrapper</refname> <refpurpose>×¢²áÒ»¸öÓà PHP ÀàʵÏÖµÄ URL ·â×°ÐÒé</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>boolean</type><methodname>file_register_wrapper</methodname> <methodparam><type>string</type><parameter>protocol</parameter></methodparam> <methodparam><type>string</type><parameter>classname</parameter></methodparam> </methodsynopsis> <para> ±¾º¯ÊýĿǰ½öͨ¹ýÒÔÏÂÀý×ÓÁÐÈëÎĵµ£º <example> <title>ʵÏÖÒ»¸ö base64 ±àÂëÐÒé</title> <programlisting role="php"> <![CDATA[ class Base64EncodingStream { var $fp = null; function stream_open($path, $mode, $options, &$opened_path) { $this->fp = fopen($path, $mode); return is_resource($this->fp); } function stream_close() { fclose($this->fp); } function stream_read($count) { return false; // We only allow writing } function stream_write($data) { return fwrite($this->fp, base64_encode($data)); } function stream_flush() { fflush($this->fp); return true; } function stream_seek($offset, $whence) { return false; } function stream_gets() { return false; } function stream_tell() { return false; } function stream_eof() { return false; } } file_register_wrapper("base64", "Base64EncodingStream") or die("Failed to register protocol"); copy("/tmp/inputfile.txt", "base64:///tmp/outputfile.txt"); readfile("/tmp/outputfile"); ]]> </programlisting> </example> </para> <para> Èç¹û <parameter>protocol</parameter> ÒѾÓÐÁ˾ä±ú£¬»òÕß¡°fopen wrappers¡±Ã»Óб»¼¤»îʱ <function>file_register_wrapper</function> ·µ»Ø &false;¡£ </para> <note> <para> ±¾º¯ÊýÊÇ PHP 4.3.0 Òý½øµÄ¡£ </para> </note> </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 -->
Index: phpdoc-zh/reference/filesystem/functions/fgetcsv.xml +++ phpdoc-zh/reference/filesystem/functions/fgetcsv.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> <refentry id="function.fgetcsv"> <refnamediv> <refname>fgetcsv</refname> <refpurpose>´ÓÎļþÖ¸ÕëÖжÁÈëÒ»Ðв¢½âÎö CSV ×Ö¶Î</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>array</type><methodname>fgetcsv</methodname> <methodparam><type>int</type><parameter>fp</parameter></methodparam> <methodparam><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> <simpara> ºÍ <function>fgets</function> ÀàËÆ£¬Ö»³ýÁË <function>fgetcsv</function> ½âÎö¶ÁÈëµÄÐв¢ÕÒ³ö <acronym>CSV</acronym> ¸ñʽµÄ×Ö¶ÎÈ»ºó·µ»ØÒ»¸ö°üº¬ÕâЩ×ֶεÄÊý×é¡£×ֶηָô·ûÊǶººÅ£¬»òÕßÓÿÉÑ¡µÄµÚÈý¸ö²ÎÊýÁíÍâÖ¸¶¨¡£×Ö¶ÎÓÃË«ÒýºÅ°üΧ£¬»òÕßÓÿÉÑ¡µÄµÚËĸö²ÎÊýÁíÍâÖ¸¶¨¡£<parameter>Delimiter</parameter> ºÍ <parameter>enclosure</parameter> ²»ÄÜÊÇ null ²¢ÇÒÖ»ÓеÚÒ»¸ö×Ö·ûÓÐЧ¡£ </simpara> <simpara> <parameter>fp</parameter> ±ØÐëÊÇͨ¹ý <function>fopen</function>£¬<function>popen</function> »òÕß <function>fsockopen</function> ³É¹¦´ò¿ªµÄÓÐЧÎļþÖ¸Õë¡£ </simpara> <simpara> <parameter>length</parameter> ±ØÐë´óÓÚ CVS ÎļþÖ㤶È×î´óµÄÐУ¨ÒÔ±ãÓÚ´¦ÀíÐнáÊø×Ö·û£©¡£ </simpara> <simpara> <function>fgetcsv</function> ³ö´íʱ·µ»Ø &false;£¬°üÀ¨Åöµ½Îļþ½áÊøÊ±¡£ </simpara> <note> <simpara> CSV ÎļþÖеĿÕÐн«±»·µ»ØÎªÒ»¸ö°üº¬Óе¥¸ö &null; ×ֶεÄÊý×飬²»»á±»µ±³É´íÎó¡£ </simpara> <simpara> <parameter>enclosure</parameter> ÊÇ PHP 4.3.0 мӵġ£ </simpara> </note> <example> <title> <function>fgetcsv</function> Àý×Ó - ¶ÁÈ¡²¢ÏÔʾ CSV ÎļþµÄÕû¸öÄÚÈÝ </title> <programlisting role="php"> <![CDATA[ $row = 1; $fp = fopen ("test.csv","r"); while ($data = fgetcsv ($fp, 1000, ",")) { $num = count ($data); print "<p> $num fields in line $row: <br>"; $row++; for ($c=0; $c < $num; $c++) { print $data[$c] . "<br>"; } } fclose ($fp); ]]> </programlisting> </example> </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 --> Index: phpdoc-zh/reference/filesystem/functions/fgetss.xml +++ phpdoc-zh/reference/filesystem/functions/fgetss.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="function.fgetss"> <refnamediv> <refname>fgetss</refname> <refpurpose>´ÓÎļþÖ¸ÕëÖжÁȡһÐв¢¹ýÂ˵ô HTML ±ê¼Ç</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>string</type><methodname>fgetss</methodname> <methodparam><type>int</type><parameter>fp</parameter></methodparam> <methodparam><type>int</type><parameter>length</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>allowable_tags</parameter></methodparam> </methodsynopsis> <para> ºÍ <function>fgets</function> Ïàͬ£¬Ö»³ýÁË fgetss ³¢ÊÔ´Ó¶ÁÈ¡µÄÎı¾ÖÐÈ¥µôÈκΠHTML ºÍ PHP ±ê¼Ç¡£ </para> <para> ¿ÉÒÔÓÿÉÑ¡µÄµÚÈý¸ö²ÎÊýÖ¸¶¨ÄÄЩ±ê¼Ç²»±»È¥µô¡£ <note> <para> <parameter>allowable_tags</parameter> ÊÇ PHP 3.0.13£¬PHP 4.0.0 мӵġ£ </para> </note> </para> <para> ²Î¼û <function>fgets</function>£¬<function>fopen</function>£¬<function>fsockopen</function>£¬<function>popen</function> ºÍ <function>strip_tags</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 --> Index: phpdoc-zh/reference/filesystem/functions/fgets.xml +++ phpdoc-zh/reference/filesystem/functions/fgets.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="function.fgets"> <refnamediv> <refname>fgets</refname> <refpurpose>´ÓÎļþÖ¸ÕëÖжÁȡһÐÐ</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>string</type><methodname>fgets</methodname> <methodparam><type>int</type><parameter>fp</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>length</parameter></methodparam> </methodsynopsis> <para> ´Ó fp Ö¸ÏòµÄÎļþÖжÁȡһÐв¢·µ»Ø³¤¶È×î¶àΪ length - 1 ×Ö½ÚµÄ×Ö·û´®¡£Åöµ½»»Ðзû£¨°üÀ¨ÔÚ·µ»ØÖµÖУ©¡¢EOF »òÕßÒѾ¶ÁÈ¡ÁË length - 1 ×Ö½ÚºóÍ£Ö¹£¨¿´ÏÈÅöµ½ÄÇÒ»ÖÖÇé¿ö£©¡£Èç¹ûûÓÐÖ¸¶¨ length£¬ÔòĬÈÏΪ 1K£¬»òÕß˵ 1024 ×Ö½Ú¡£ </para> <para> ³ö´íʱ·µ»Ø &false;¡£ </para> <para> ͨ³£µÄȱÏÝ£º </para> <simpara> ϰ¹ßÁË C ÓïÑÔÖÐ <function>fgets</function> Óï·¨µÄÈËÓ¦¸Ã×¢Òâµ½ <literal>EOF</literal> ÊÇÔõÑù±»·µ»ØµÄ¡£ </simpara> <simpara> ÎļþÖ¸Õë±ØÐëÓÐЧ£¬²¢ÇÒÊÇͨ¹ý <function>fopen</function> »ò <function>fsockopen</function> ³É¹¦´ò¿ªµÄ¡£ </simpara> <para> ÒÔÏÂÊÇÒ»¸ö¼òµ¥Àý×Ó£º <example> <title>ÖðÐжÁÈ¡Îļþ</title> <programlisting role="php"> <![CDATA[ $fd = fopen ("/tmp/inputfile.txt", "r"); while (!feof ($fd)) { $buffer = fgets($fd, 4096); echo $buffer; } fclose ($fd); ]]> </programlisting> </example> </para> <note> <simpara> <parameter>length</parameter> ²ÎÊý´Ó PHP 4.2.0 Æð³ÉΪ¿ÉÑ¡Ïî¡£ </simpara> </note> <para> ²Î¼û <function>fread</function>£¬<function>fopen</function>£¬<function>popen</function>£¬<function>fgetc</function>£¬<function>fsockopen</function> ºÍ <function>socket_set_timeout</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 --> Index: phpdoc-zh/reference/filesystem/functions/file-exists.xml +++ phpdoc-zh/reference/filesystem/functions/file-exists.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> <refentry id="function.file-exists"> <refnamediv> <refname>file_exists</refname> <refpurpose>¼ì²éÎļþÊÇ·ñ´æÔÚ</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>bool</type><methodname>file_exists</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> </methodsynopsis> <simpara> Èç¹ûÓÉ <parameter>filename</parameter> Ö¸¶¨µÄÎļþ´æÔÚÔò·µ»Ø &true;£¬·ñÔò·µ»Ø &false;¡£ </simpara> <simpara> ±¾º¯Êý²»ÄÜÓÃÓÚ<link linkend="features.remote-files">Ô¶³ÌÎļþ</link>£¬±»¼ì²éµÄÎļþ±ØÐëͨ¹ý·þÎñÆ÷µÄÎļþϵͳÀ´·ÃÎÊ¡£ </simpara> <simpara> ±¾º¯ÊýµÄ·µ»Ø½á¹û»á±»»º´æ¡£¸ü¶àÏêϸ×ÊÁϼû <function>clearstatcache</function>¡£ </simpara> <simpara> ÔÚ Windows ÖÐÒªÓà "//computername/share/filename" »òÕß "\\\\computername\share\filename" À´¼ì²éÍøÂçÖеĹ²ÏíÎļþ¡£ </simpara> </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 --> Index: phpdoc-zh/reference/filesystem/functions/file-get-contents.xml +++ phpdoc-zh/reference/filesystem/functions/file-get-contents.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> <refentry id="function.file-get-contents"> <refnamediv> <refname>file_get_contents</refname> <refpurpose>½«Õû¸öÎļþ¶ÁÈëÒ»¸ö×Ö·û´®</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>string</type><methodname>file_get_contents</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>use_include_path</parameter></methodparam> </methodsynopsis> <para> ºÍ <function>readfile</function> Ò»Ñù£¬Ö»³ýÁË <function>file_get_contents</function> ½«Îļþ·µ»ØÎªÒ»¸ö×Ö·û´®¡£ </para> ¬e.bin-safe; &tip.fopen-wrapper; <simpara> ²Î¼û <function>fgets</function>£¬<function>file</function>£¬<function>fread</function>£¬<function>include</function> ºÍ <function>readfile</function>¡£ </simpara> </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 --> Index: phpdoc-zh/reference/filesystem/functions/file-get-wrapper-data.xml +++ phpdoc-zh/reference/filesystem/functions/file-get-wrapper-data.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> <refentry id="function.file-get-wrapper-data"> <refnamediv> <refname>file_get_wrapper_data</refname> <refpurpose>´Ó·â×°ÐÒéÎļþÖ¸ÕëÖÐÈ¡µÃ±¨Í·£¯ÔªÊý¾Ý</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>mixed</type><methodname>file_get_wrapper_data</methodname> <methodparam><type>int</type><parameter>fp</parameter></methodparam> </methodsynopsis> <simpara> ±¾º¯Êý·µ»ØÍ¨¹ý <function>fopen</function> ´ò¿ªµÄÎļþµÄ±¨Í·»òÕßÔªÊý¾Ý¡£¿ÉÒÔÓÃÀ´·µ»Ø HTTP Á¬½ÓµÄÏìÓ¦±¨Í·£¬»òÕ߯äËü×ÊÔ´µÄͳ¼ÆÊý¾Ý¡£ </simpara> <simpara> ·µ»ØÊý¾ÝµÄ¸ñʽ¹ÊÒâ²»ÔÚ´ËʱÁÐÈëÎĵµ£¬²¢ÇÒ¸ù¾ÝʹÓÃÁËÄÄÖÖ·â×°ÐÒé¶ø²»Í¬¡£ </simpara> <note> <para> ±¾º¯ÊýÊÇ PHP 4.3.0 Òý½øµÄ¡£ </para> </note> </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 --> Index: phpdoc-zh/reference/filesystem/functions/file.xml +++ phpdoc-zh/reference/filesystem/functions/file.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="function.file"> <refnamediv> <refname>file</refname> <refpurpose>°ÑÕû¸öÎļþ¶ÁÈëÒ»¸öÊý×éÖÐ</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</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> </methodsynopsis> <para> ºÍ <function>readfile</function> Ò»Ñù£¬Ö»³ýÁË <function>file</function> ½«Îļþ×÷Ϊһ¸öÊý×é·µ»Ø¡£Êý×éÖеÄÿ¸öµ¥Ôª¶¼ÊÇÎļþÖÐÏàÓ¦µÄÒ»ÐУ¬°üÀ¨»»ÐзûÔÚÄÚ¡£ </para> <note> <para> ·µ»ØµÄÊý×éÖÐÿһÐж¼°üÀ¨ÁËÐнáÊø·û£¬Òò´ËÈç¹û²»ÐèÒªÐнáÊø·ûʱ»¹ÐèҪʹÓà <function>trim</function> º¯Êý¡£ </para> </note> <para> ¿ÉÒÔ½«¿ÉÑ¡µÄµÚ¶þ¸ö²ÎÊýÉèΪ "1"£¬Èç¹ûÒ²ÏëÔÚ <link linkend="ini.include-path">include_path</link> ÖÐËÑѰÎļþµÄ»°¡£ </para> <para> <informalexample> <programlisting role="php"> <![CDATA[ <?php // ½«Ò»¸ö web Ò³Ãæ¶ÁÈëµ½Ò»¸öÊý×éÖв¢Êä³ö $fcontents = file ('http://www.example.com/'); while (list ($line_num, $line) = each ($fcontents)) { echo "<b>Line $line_num:</b>; ", htmlspecialchars ($line), "<br>\n"; } // ½«Ò»¸ö web Ò³Ãæ¶ÁÈëµ½Ò»¸ö×Ö·û´® $fcontents = implode ('', file ('http://www.example.com/')); ?> ]]> </programlisting> </informalexample> </para> <note> <para> ´Ó PHP 4.3.0 ¿ªÊ¼¿ÉÒÔÓà <function>file_get_contents</function> À´½«Îļþ¶ÁÈëµ½Ò»¸ö×Ö·û´®·µ»Ø£¬¶þ½øÖÆÎļþÒ²¿ÉÒÔ¡£ </para> </note> ¬e.not-bin-safe; &tip.fopen-wrapper; <para> ²Î¼û <function>readfile</function>£¬<function>fopen</function>£¬<function>fsockopen</function> ºÍ <function>popen</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 --> Index: phpdoc-zh/reference/filesystem/functions/file-register-wrapper.xml +++ phpdoc-zh/reference/filesystem/functions/file-register-wrapper.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="function.file-register-wrapper"> <refnamediv> <refname>file_register_wrapper</refname> <refpurpose>×¢²áÒ»¸öÓà PHP ÀàʵÏÖµÄ URL ·â×°ÐÒé</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>boolean</type><methodname>file_register_wrapper</methodname> <methodparam><type>string</type><parameter>protocol</parameter></methodparam> <methodparam><type>string</type><parameter>classname</parameter></methodparam> </methodsynopsis> <para> ±¾º¯ÊýĿǰ½öͨ¹ýÒÔÏÂÀý×ÓÁÐÈëÎĵµ£º <example> <title>ʵÏÖÒ»¸ö base64 ±àÂëÐÒé</title> <programlisting role="php"> <![CDATA[ class Base64EncodingStream { var $fp = null; function stream_open($path, $mode, $options, &$opened_path) { $this->fp = fopen($path, $mode); return is_resource($this->fp); } function stream_close() { fclose($this->fp); } function stream_read($count) { return false; // We only allow writing } function stream_write($data) { return fwrite($this->fp, base64_encode($data)); } function stream_flush() { fflush($this->fp); return true; } function stream_seek($offset, $whence) { return false; } function stream_gets() { return false; } function stream_tell() { return false; } function stream_eof() { return false; } } file_register_wrapper("base64", "Base64EncodingStream") or die("Failed to register protocol"); copy("/tmp/inputfile.txt", "base64:///tmp/outputfile.txt"); readfile("/tmp/outputfile"); ]]> </programlisting> </example> </para> <para> Èç¹û <parameter>protocol</parameter> ÒѾÓÐÁ˾ä±ú£¬»òÕß¡°fopen wrappers¡±Ã»Óб»¼¤»îʱ <function>file_register_wrapper</function> ·µ»Ø &false;¡£ </para> <note> <para> ±¾º¯ÊýÊÇ PHP 4.3.0 Òý½øµÄ¡£ </para> </note> </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 -->