PHP fnmatch() Function
Complete PHP Filesystem Reference
Definition and Usage
The fnmatch() function matches a filename or string against the specified pattern.
Syntax
fnmatch(pattern,string,flags)
|
Parameter |
Description |
pattern |
Required. Specifies the pattern to search for |
string |
Required. Specifies the string or file check |
flags |
Optional. |
Tips and Notes
Note: This function is not implemented on Windows
platforms.
Example
Checking a color name against a shell wildcard pattern:
<?php
$txt = "My car is darkgrey..."
if (fnmatch("*gr[ae]y",$txt))
{
echo "some form of gray ...";
}
?>
|
Complete PHP Filesystem Reference
Whether you're new to XML or already an advanced user, the user-friendly views
and powerful entry helpers, wizards, and debuggers in XMLSpy are designed to
meet your XML and Web services development needs from start to finish.
- XML editor
- Graphical XML Schema / DTD editors
- XSLT 1.0/2.0 editor, debugger, profiler
- XQuery editor, debugger, profiler
- Support for Office Open XML (OOXML)
- Graphical WSDL editor & SOAP debugger
- Java, C#, C++ code generation
- And much more!
Download a fully functional free 30-day trial today!
|