mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Marking constants with <constant>, WS, and compacted the example.
Also, removed uneeded john@php.net comment. Also, this function is available as of 4.3.0 so no need to specific per constant. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@104399 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
0b23d6c686
commit
572fa58ab8
1 changed files with 43 additions and 22 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<refentry id="function.glob">
|
||||
<refnamediv>
|
||||
<refname>glob</refname>
|
||||
|
@ -21,50 +21,71 @@
|
|||
Returns an array containing the matched files/directories or &false; on
|
||||
error.
|
||||
</para>
|
||||
<para> <!-- Added by john (john@php.net) //-->
|
||||
<para>
|
||||
Valid flags:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara>GLOB_MARK - Adds a slash to each item returned</simpara>
|
||||
<simpara>
|
||||
<constant>GLOB_MARK</constant> - Adds a slash to each item returned
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>GLOB_NOSORT - Return files as they appear in the directory (no sorting)</simpara>
|
||||
<simpara>
|
||||
<constant>GLOB_NOSORT</constant> - Return files as they appear in the
|
||||
directory (no sorting)
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>GLOB_NOCHECK - Return the search pattern if no files matching it were found</simpara>
|
||||
<simpara>
|
||||
<constant>GLOB_NOCHECK</constant> - Return the search pattern if no
|
||||
files matching it were found
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>GLOB_NOESCAPE - Backslashes do not quote metacharacters</simpara>
|
||||
<simpara>
|
||||
<constant>GLOB_NOESCAPE</constant> - Backslashes do not quote
|
||||
metacharacters
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>GLOB_BRACE - Expands {a,b,c} to match 'a', 'b', or 'c' (PHP >= 4.3.0)</simpara>
|
||||
<simpara>
|
||||
<constant>GLOB_BRACE</constant> - Expands {a,b,c} to match 'a', 'b',
|
||||
or 'c'
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>GLOB_ONLYDIR - Return only directory entries which match the pattern (PHP >= 4.3.0)</simpara>
|
||||
<simpara>
|
||||
<constant>GLOB_ONLYDIR</constant> - Return only directory entries
|
||||
which match the pattern
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<example>
|
||||
<title>
|
||||
Convenient way how <function>glob</function> can replace
|
||||
<function>opendir</function> and friends.
|
||||
</title>
|
||||
<programlisting role="php">
|
||||
<para>
|
||||
<example>
|
||||
<title>
|
||||
Convenient way how <function>glob</function> can replace
|
||||
<function>opendir</function> and friends.
|
||||
</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
foreach (glob("*.txt") as $filename) {
|
||||
echo "$filename size " . filesize($filename) . "\n";
|
||||
}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
This could result in the following output:
|
||||
</para>
|
||||
<screen>
|
||||
|
||||
/* Output will look something like:
|
||||
|
||||
funclist.txt size 44686
|
||||
funcsummary.txt size 267625
|
||||
quickref.txt size 137820
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
*/
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>opendir</function>,
|
||||
<function>readdir</function> and
|
||||
|
|
Loading…
Reference in a new issue