From f2b3768ed10a4515a9876af6cafce6db6c9c7ab1 Mon Sep 17 00:00:00 2001 From: Hartmut Holzgraefe Date: Thu, 26 Sep 2002 00:31:29 +0000 Subject: [PATCH] glob() and fnmatch() updates git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@96909 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/filesystem/functions/fnmatch.xml | 69 ++++++++++++++++++++++ reference/filesystem/functions/glob.xml | 13 ++-- 2 files changed, 73 insertions(+), 9 deletions(-) create mode 100644 reference/filesystem/functions/fnmatch.xml diff --git a/reference/filesystem/functions/fnmatch.xml b/reference/filesystem/functions/fnmatch.xml new file mode 100644 index 0000000000..2e47e7feb4 --- /dev/null +++ b/reference/filesystem/functions/fnmatch.xml @@ -0,0 +1,69 @@ + + + + + fnmatch + Match filename against a pattern + + + Description + + arrayfnmatch + stringpattern + stringstring + intflags + + + fnmatch checks if the passed string would + match the given shell wildcard pattern. + + + This is especialy usefull for filenames, but may also be used on regular strings. + The average user may be used to shell patterns or at least in their simplest form + to '?' and '*' wildcards so using + fnmatch instead of ereg or + preg_match for frontend search expression input may be + way more convenient for non-programming users. + + + + Checking a color name against a shell wildcard pattern. + + + + + + + See also glob, + ereg, + preg_match + and the unix manpage on fnmatch(3) for flag names + (as long as they are not documented here ). + + + + + diff --git a/reference/filesystem/functions/glob.xml b/reference/filesystem/functions/glob.xml index cebe3deefe..77663a72d5 100644 --- a/reference/filesystem/functions/glob.xml +++ b/reference/filesystem/functions/glob.xml @@ -1,5 +1,5 @@ - + glob @@ -21,13 +21,6 @@ Returns an array containing the matched files/directories or &false; on error. - - - This function is disabled in safe mode and therefore will always - return &false; in safe mode. - - Convenient way how <function>glob</function> can replace @@ -52,7 +45,9 @@ quickref.txt size 137820 <para> See also <function>opendir</function>, <function>readdir</function> and - <function>closedir</function>. + <function>closedir</function>, <function>fnmatch</function> + and the unix manpage on <literal>glob(3)</literal> for flag names + (as long as they are not documented here <!-- TODO hartmut -->). </para> </refsect1> </refentry>