cvs: phpdoc-zh /reference/dir/functions scandir.xml
| From: | Dallas Thunder | Date: | Sun, 24 Aug 2003 20:35:05 +0000 |
| Subject: | cvs: phpdoc-zh /reference/dir/functions scandir.xml | ||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-1672@lists.php.net to get a copy of this message | ||
dallas Sun Aug 24 16:35:05 2003 EDT
Added files:
/phpdoc-zh/reference/dir/functions scandir.xml
Log:
Complete an new file.
Index: phpdoc-zh/reference/dir/functions/scandir.xml
+++ phpdoc-zh/reference/dir/functions/scandir.xml
<?xml version="1.0" encoding="gb2312"?>
<!-- $Revision: 1.1 $ -->
<!-- $Author: dallas $ -->
<!-- EN-Revision: 1.1 Maintainer: dallas Status: ready -->
<refentry id="function.scandir">
<refnamediv>
<refname>scandir</refname>
<refpurpose>
ÁгöÖ¸¶¨Â·¾¶ÖеÄÎļþºÍĿ¼
</refpurpose>
</refnamediv>
<refsect1>
<title>˵Ã÷</title>
<methodsynopsis>
<type>array</type><methodname>scandir</methodname>
<methodparam><type>string</type><parameter>directory</parameter></methodparam>
<methodparam
choice="opt"><type>int</type><parameter>sorting_order</parameter></methodparam>
</methodsynopsis>
<para>
·µ»ØÒ»¸ö <type>array</type>£¬°üº¬ÓÐ
<parameter>directory</parameter> ÖеÄÎļþºÍĿ¼¡£Èç¹û
<parameter>directory</parameter>
²»ÊÇÒ»¸öĿ¼£¬Ôò·µ»Ø²¼¶ûÖµ
&false;£¬²¢²úÉúÒ»Ìõ
<constant>E_WARNING</constant> ¼¶±ðµÄ´íÎó¡£
</para>
<para>
ĬÈÏÇé¿öÏ£¬·µ»ØÖµÊǰ´ÕÕ×Öĸ˳ÐòÉýÐòÅÅÁеġ£Èç¹ûʹÓÃÁË¿ÉÑ¡²ÎÊý
<parameter>sorting_order</parameter>£¨ÉèΪ
1£©£¬Ôò°´ÕÕ×Öĸ˳Ðò½µÐòÅÅÁС£
</para>
<para>
<example>
<title>¼òµ¥µÄ <function>scandir</function> Àý×Ó</title>
<programlisting role="php">
<![CDATA[
<?php
$dir = '/tmp';
$files1 = scandir($dir);
$files2 = scandir($dir, 1);
print_r($files1);
print_r($files2);
/* Outputs something like:
Array
(
[0] => .
[1] => ..
[2] => bar.php
[3] => foo.txt
[4] => somedir
)
Array
(
[0] => somedir
[1] => foo.txt
[2] => bar.php
[3] => ..
[4] => .
)
*/
?>
]]>
</programlisting>
</example>
</para>
<para>
<example>
<title><function>scandir</function> ÔÚ PHP 4
ÖеÄʵÏÖ</title>
<programlisting role="php">
<![CDATA[
<?php
$dir = "/tmp";
$dh = opendir($dir);
while (false !== ($filename = readdir($dh))) {
$files[] = $filename;
}
sort($files);
print_r($files);
rsort($files);
print_r($files);
/* Outputs something like:
Array
(
[0] => .
[1] => ..
[2] => bar.php
[3] => foo.txt
[4] => somedir
)
Array
(
[0] => somedir
[1] => foo.txt
[2] => bar.php
[3] => ..
[4] => .
)
*/
?>
]]>
</programlisting>
</example>
</para>
<para>
²Î¼û
<function>opendir</function>£¬<function>readdir</function>£¬<function>glob</function>£¬<function>is_dir</function>
ºÍ <function>sort</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
-->