note 72490 added to function.fnmatch

From: Date: Sun, 21 Jan 2007 03:40:26 +0000
Subject: note 72490 added to function.fnmatch
Groups: php.notes 
Request: Send a blank email to php-notes+get-121974@lists.php.net to get a copy of this message
A revised better alternative for fnmatch on windows. It should work well on PHP >= 4.0.0 <?php if (!function_exists('fnmatch')) { function fnmatch($pattern, $string) { return @preg_match( '/^' . strtr(addcslashes($pattern, '/\\.+^$(){}=!<>|'), array('*' => '.*', '?' => '.?')) . '$/i', $string ); } } ?> ---- Server IP: 130.206.1.5 Probable Submitter: 81.202.119.16 ---- Manual Page -- http://www.php.net/manual/en/function.fnmatch.php Edit -- https://master.php.net/note/edit/72490 Del: integrated -- https://master.php.net/note/delete/72490/integrated Del: useless -- https://master.php.net/note/delete/72490/useless Del: bad code -- https://master.php.net/note/delete/72490/bad+code Del: spam -- https://master.php.net/note/delete/72490/spam Del: non-english -- https://master.php.net/note/delete/72490/non-english Del: in docs -- https://master.php.net/note/delete/72490/in+docs Del: other reasons-- https://master.php.net/note/delete/72490 Reject -- https://master.php.net/note/reject/72490 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#121974) next »