cvs: phpdoc-pl /reference/dir/functions scandir.xml
| From: | Leszek Krupinski | Date: | Mon, 07 Mar 2005 16:02:26 +0000 |
| Subject: | cvs: phpdoc-pl /reference/dir/functions scandir.xml | ||
| Groups: | php.doc.pl | ||
| Request: | Send a blank email to doc-pl+get-542@lists.php.net to get a copy of this message | ||
leszek Mon Mar 7 11:02:26 2005 EDT
Added files:
/phpdoc-pl/reference/dir/functions scandir.xml
Log:
[leniwiec] *** empty log message ***
http://cvs.php.net/co.php/phpdoc-pl/reference/dir/functions/scandir.xml?r=1.1&p=1
Index: phpdoc-pl/reference/dir/functions/scandir.xml
+++ phpdoc-pl/reference/dir/functions/scandir.xml
<?xml version="1.0" encoding="iso-8859-2"?>
<!-- EN-Revision: 1.7 Maintainer: leniwiec Status: ready -->
<!-- $Revision: 1.1 $ -->
<refentry id="function.scandir">
<refnamediv>
<refname>scandir</refname>
<refpurpose>Wypisze wszystkie pliki i katalogi z okre¶lonej lokalizacji
</refpurpose>
</refnamediv>
<refsect1>
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>scandir</methodname>
<methodparam><type>string</type><parameter>katalog</parameter></methodparam>
<methodparam
choice="opt"><type>int</type><parameter>sorting_order</parameter></methodparam>
<methodparam
choice="opt"><type>resource</type><parameter>context</parameter></methodparam>
</methodsynopsis>
<para>
Zwraca <type>array</type> z wszystkimi plikami i katalogami znajduj±cymi
siê w <parameter>katalog</parameter>.
Je¶li <parameter>katalog</parameter> nie jest katalogiem, zwraca &false;,
oraz ustawia b³±d <constant>E_WARNING</constant>.
</para>
<para>
Domy¶lnie, kolejno¶æ w zwróconej tablicy jest alfabetyczna, rosn±ca.
Je¶li parametr <parameter>sorting_order</parameter> zosta³a podany
(ustawiony
na 1) wówczas kolejno¶æ jest alfabetyczna, malej±ca.
</para>
<para>
Parametr <parameter>context</parameter> jest opisany w <xref
linkend="ref.stream"/>.
</para>
<para>
<example>
<title>Prosty przyk³ad u¿ycia <function>scandir</function></title>
<programlisting role="php">
<![CDATA[
<?php
$dir = '/tmp';
$files1 = scandir($dir);
$files2 = scandir($dir, 1);
print_r($files1);
print_r($files2);
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
Array
(
[0] => .
[1] => ..
[2] => bar.php
[3] => foo.txt
[4] => somedir
)
Array
(
[0] => somedir
[1] => foo.txt
[2] => bar.php
[3] => ..
[4] => .
)
]]>
</screen>
</example>
</para>
<para>
<example>
<title>Alternatywa dla <function>scandir</function> w 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);
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
Array
(
[0] => .
[1] => ..
[2] => bar.php
[3] => foo.txt
[4] => somedir
)
Array
(
[0] => somedir
[1] => foo.txt
[2] => bar.php
[3] => ..
[4] => .
)
]]>
</screen>
</example>
</para>
&tip.fopen-wrapper;
<para>
Patrz tak¿e <function>opendir</function>,
<function>readdir</function>,
<function>glob</function>,
<function>is_dir</function>, oraz
<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
-->