- Preliminary documentation for glob().

# Far from finished, volunteers are welcome:
# - Document tll he flags
# - Give more examples
# - Describe what the patterns are really


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@82640 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Markus Fischer 2002-05-18 14:08:25 +00:00
parent 70c42e038a
commit aba468e56f
2 changed files with 84 additions and 0 deletions

View file

@ -41,6 +41,7 @@
&reference.filesystem.functions.ftell;
&reference.filesystem.functions.ftruncate;
&reference.filesystem.functions.fwrite;
&reference.filesystem.functions.glob;
&reference.filesystem.functions.is-dir;
&reference.filesystem.functions.is-executable;
&reference.filesystem.functions.is-file;

View file

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<refentry id="function.glob">
<refnamediv>
<refname>glob</refname>
<refpurpose>Find pathnames matching a pattern</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>glob</methodname>
<methodparam><type>string</type><parameter>pattern</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam>
</methodsynopsis>
<para>
The <function>glob</function> function searches for all the pathnames
matching <parameter>pattern</parameter> according to the rules used by
the shell. No tilde expansion or parameter substitution is done.
</para>
<para>
Returns an array containing the matched files/directories or &false; on
error.
</para>
<note>
<para>
This function is disabled in <link
linkend="ini.safe-mode">safe mode</link>.
</para>
</note>
<warning>
<para>
This function is not available on the Windows platform.
</para>
</warning>
<example>
<title>
Convenient way how <function>glob</function> can replace
<function>opendir</function> and friends.
</title>
<programlisting role="php">
<![CDATA[
foreach (glob("*.txt") as $filename) {
echo "$filename size " . filesize($filename) . "\n";
}
]]>
</programlisting>
<para>
This could result in the following output:
</para>
<screen>
funclist.txt size 44686
funcsummary.txt size 267625
quickref.txt size 137820
</screen>
</example>
<para>
See also <function>opendir</function>,
<function>readdir</function> and
<function>closedir</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
-->