note 107178 added to function.preg-quote

From: Date: Thu, 12 Jan 2012 13:11:02 +0000
Subject: note 107178 added to function.preg-quote
Groups: php.notes 
Request: Send a blank email to php-notes+get-185610@lists.php.net to get a copy of this message
If you need to quote everything but a wildcard, maybe this function will come handy to you: protected function _ruleOptionIsMatched($option, $subject) { $option = preg_quote($option, '#'); $option = str_replace('\*', '.*', $option); if(preg_match("#^$option$#", $subject)) { return true; } else { return false; } } ---- Server IP: 69.147.83.197 Probable Submitter: 83.212.95.241 ---- Manual Page -- http://www.php.net/manual/en/function.preg-quote.php Edit -- https://master.php.net/note/edit/107178 Del: integrated -- https://master.php.net/note/delete/107178/integrated Del: useless -- https://master.php.net/note/delete/107178/useless Del: bad code -- https://master.php.net/note/delete/107178/bad+code Del: spam -- https://master.php.net/note/delete/107178/spam Del: non-english -- https://master.php.net/note/delete/107178/non-english Del: in docs -- https://master.php.net/note/delete/107178/in+docs Del: other reasons-- https://master.php.net/note/delete/107178 Reject -- https://master.php.net/note/reject/107178 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#185610) next »