cvs: phpdoc-zh /reference/filesystem/functions fscanf.xml fseek.xml

From: Date: Fri, 11 Apr 2003 16:18:47 +0000
Subject: cvs: phpdoc-zh /reference/filesystem/functions fscanf.xml fseek.xml
Groups: php.doc.zh 
Request: Send a blank email to doc-zh+get-1331@lists.php.net to get a copy of this message
dallas Fri Apr 11 12:18:47 2003 EDT Modified files: /phpdoc-zh/reference/filesystem/functions fscanf.xml fseek.xml Log: Done.

Index: phpdoc-zh/reference/filesystem/functions/fscanf.xml diff -u phpdoc-zh/reference/filesystem/functions/fscanf.xml:1.1 phpdoc-zh/reference/filesystem/functions/fscanf.xml:1.2 --- phpdoc-zh/reference/filesystem/functions/fscanf.xml:1.1 Sun Sep 29 22:56:19 2002 +++ phpdoc-zh/reference/filesystem/functions/fscanf.xml Fri Apr 11 12:18:46 2003 @@ -1,46 +1,42 @@ -<?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> -<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 --> +<?xml version="1.0" encoding="gb2312"?> +<!-- $Revision: 1.2 $ --> +<!-- $Author: dallas $ --> +<!-- EN-Revision: 1.7 Maintainer: dallas Status: ready --> <refentry id="function.fscanf"> <refnamediv> <refname>fscanf</refname> - <refpurpose>Parses input from a file according to a format</refpurpose> + <refpurpose>´ÓÎļþÖиñʽ»¯ÊäÈë</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>˵Ã÷</title> <methodsynopsis> <type>mixed</type><methodname>fscanf</methodname> - <methodparam><type>int</type><parameter>handle</parameter></methodparam> + <methodparam><type>resource</type><parameter>handle</parameter></methodparam> <methodparam><type>string</type><parameter>format</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>var1</parameter></methodparam> </methodsynopsis> <para> - The function <function>fscanf</function> is similar to - <function>sscanf</function>, but it takes its input from a file - associated with <parameter>handle</parameter> and interprets the - input according to the specified - <parameter>format</parameter>. If only two parameters were passed - to this function, the values parsed will be returned as an array. - Otherwise, if optional parameters are passed, the function will - return the number of assigned values. The optional parameters - must be passed by reference. + <function>fscanf</function> º¯ÊýºÍ + <function>sscanf</function> ÏàËÆ£¬µ«ÊÇËü´ÓÓë + <parameter>handle</parameter> ¹ØÁªµÄÎļþÖнÓÊÜÊäÈë²¢¸ù¾ÝÖ¸¶¨µÄ + <parameter>format</parameter> + À´½âÊÍÊäÈë¡£Èç¹ûÖ»¸ø´Ëº¯Êý´«µÝÁËÁ½¸ö²ÎÊý£¬½âÎöºóµÄÖµ»á±»×÷ΪÊý×é·µ»Ø¡£·ñÔò£¬Èç¹ûÌṩÁË¿ÉÑ¡²ÎÊý£¬´Ëº¯Êý½«·µ»Ø±»¸³ÖµµÄÊýÄ¿¡£¿ÉÑ¡²ÎÊý±ØÐëÓÃÒýÓô«µÝ¡£ </para> <para> - Any whitespace in the format string matches any whitespace in the input - stream. This means that even a tab <literal>\t</literal> in the format - string can match a single space character in the input stream. + ¸ñʽ×Ö·û´®ÖеÄÈκοհ׻áÓëÊäÈëÁ÷ÖеÄÈÎºÎ¿Õ°×Æ¥Åä¡£ÕâÒâζ×ÅÉõÖÁ¸ñʽ×Ö·û´®ÖеÄÖÆ±í·û + <literal>\t</literal> Ò²»áÓëÊäÈëÁ÷ÖеÄÒ»¸ö¿Õ¸ñ×Ö·ûÆ¥Åä¡£ </para> <para> <example> - <title><function>fscanf</function> Example</title> + <title><function>fscanf</function> Àý×Ó</title> <programlisting role="php"> - <![CDATA[ -$fp = fopen ("users.txt","r"); -while ($userinfo = fscanf ($fp, "%s\t%s\t%s\n")) { +<![CDATA[ +$handle = fopen ("users.txt","r"); +while ($userinfo = fscanf ($handle, "%s\t%s\t%s\n")) { list ($name, $profession, $countrycode) = $userinfo; //... do something with the values } -fclose($fp); +fclose($handle); ]]> </programlisting> </example> @@ -56,10 +52,17 @@ </programlisting> </example> </para> + <note> + <simpara> + ÔÚ PHP 4.3.0 ֮ǰ£¬´ÓÎļþÖжÁÈëµÄ×î´ó×Ö·ûÊýÊÇ + 512£¨»òÕßµÚÒ»¸ö \n£¬¿´ÏÈÅöµ½ÄÄÖÖÇé¿ö£©¡£´Ó + PHP 4.3.0 Æð¿ÉÒÔ¶ÁÈ¡ÈÎÒⳤµÄÐС£ + </simpara> + </note> <para> - See also <function>fread</function>, <function>fgets</function>, - <function>fgetss</function>, <function>sscanf</function>, - <function>printf</function>, and <function>sprintf</function>. + ²Î¼û + <function>fread</function>£¬<function>fgets</function>£¬<function>fgetss</function>£¬<function>sscanf</function>£¬<function>printf</function> + ºÍ <function>sprintf</function>¡£ </para> </refsect1> </refentry> Index: phpdoc-zh/reference/filesystem/functions/fseek.xml diff -u phpdoc-zh/reference/filesystem/functions/fseek.xml:1.1 phpdoc-zh/reference/filesystem/functions/fseek.xml:1.2 --- phpdoc-zh/reference/filesystem/functions/fseek.xml:1.1 Sun Sep 29 22:56:19 2002 +++ phpdoc-zh/reference/filesystem/functions/fseek.xml Fri Apr 11 12:18:47 2003 @@ -1,54 +1,57 @@ -<?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> -<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 --> +<?xml version="1.0" encoding="gb2312"?> +<!-- $Revision: 1.2 $ --> +<!-- $Author: dallas $ --> +<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> <refentry id="function.fseek"> <refnamediv> <refname>fseek</refname> - <refpurpose>Seeks on a file pointer</refpurpose> + <refpurpose>ÔÚÎļþÖ¸ÕëÖж¨Î»</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>˵Ã÷</title> <methodsynopsis> <type>int</type><methodname>fseek</methodname> - <methodparam><type>int</type><parameter>fp</parameter></methodparam> + <methodparam><type>resource</type><parameter>handle</parameter></methodparam> <methodparam><type>int</type><parameter>offset</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>whence</parameter></methodparam> </methodsynopsis> <para> - Sets the file position indicator for the file referenced by - <parameter>fp</parameter>.The new position, measured in bytes - from the beginning of the file, is obtained by adding - <parameter>offset</parameter> to the position specified by - <parameter>whence</parameter>, whose values are defined as - follows: + ÔÚÓë + <parameter>handle</parameter> + ¹ØÁªµÄÎļþÖÐÉ趨ÎļþÖ¸ÕëλÖá£ÐÂλÖ㬴ÓÎļþÍ·¿ªÊ¼ÒÔ×Ö½ÚÊý¶ÈÁ¿£¬ÊÇÒÔ + <parameter>whence</parameter> + Ö¸¶¨µÄλÖüÓÉÏ + <parameter>offset</parameter>¡£<parameter>whence</parameter> + µÄÖµ¶¨ÒåΪ£º <simplelist> - <member>SEEK_SET - Set position equal to <parameter>offset</parameter> bytes.</member> - <member>SEEK_CUR - Set position to current location plus <parameter>offset</parameter>.</member> - <member>SEEK_END - Set position to end-of-file plus <parameter>offset</parameter>. - (To move to a position before the end-of-file, you need to pass a negative - value in <parameter>offset</parameter>.)</member> + <member><constant>SEEK_SET</constant> - É趨λÖõÈÓÚ <parameter>offset</parameter> ×Ö½Ú¡£</member> + <member><constant>SEEK_CUR</constant> - É趨λÖÃΪµ±Ç°Î»ÖüÓÉÏ <parameter>offset</parameter>¡£</member> + <member><constant>SEEK_END</constant> - É趨λÖÃΪÎļþβ¼ÓÉÏ + <parameter>offset</parameter>¡££¨ÒªÒƶ¯µ½Îļþβ֮ǰµÄλÖã¬ÐèÒª¸ø + <parameter>offset</parameter> ´«µÝÒ»¸ö¸ºÖµ¡££©</member> </simplelist> </para> - <para>If <parameter>whence</parameter> is not specified, it is assumed to be - SEEK_SET. + <para> + Èç¹ûûÓÐÖ¸¶¨ + <parameter>whence</parameter>£¬Ä¬ÈÏΪ + <constant>SEEK_SET</constant>¡£ </para> <para> - Upon success, returns 0; otherwise, returns -1. Note that seeking - past EOF is not considered an error. + ³É¹¦·µ»Ø 0£»·ñÔò·µ»Ø -1¡£×¢ÒâÒÆ¶¯µ½ EOF Ö®ºóµÄλÖò»Ëã´íÎó¡£ </para> <para> - May not be used on file pointers returned by - <function>fopen</function> if they use the "http://" or "ftp://" - formats. + ¿ÉÄܲ»ÄÜÓÃÓÚÔÚ + <function>fopen</function> + ÖÐÒÔ "http://" »ò "ftp://" ¸ñʽ´ò¿ªËù·µ»ØµÄÎļþÖ¸Õë¡£ </para> <note> <para> - The <parameter>whence</parameter> argument was added after PHP 4.0.0. + <parameter>whence</parameter> ²ÎÊýÊÇ PHP 4.0.0 Ö®ºóÔö¼ÓµÄ¡£ </para> </note> <para> - See also <function>ftell</function> and - <function>rewind</function>. + ²Î¼û <function>ftell</function> ºÍ + <function>rewind</function>¡£ </para> </refsect1> </refentry>
« previous php.doc.zh (#1331) next »