note 107136 added to function.preg-match

From: Date: Tue, 10 Jan 2012 11:03:41 +0000
Subject: note 107136 added to function.preg-match
Groups: php.notes 
Request: Send a blank email to php-notes+get-185516@lists.php.net to get a copy of this message
I am trying to add the wildcard to my statement but everything I try it will not work. Below statement works. How do I perform a match using wildcards so if anything with jpg will return a match and /or any that returns a car* will return a match. <?php $image=mysql_result($result,$i,"image"); if (preg_match("/image/", "car.jpg")) echo "Match was found <br />"; else echo "Match was not found"; ?> ---- Server IP: 69.147.83.197 Probable Submitter: 99.240.24.201 ---- Manual Page -- http://www.php.net/manual/en/function.preg-match.php Edit -- https://master.php.net/note/edit/107136 Del: integrated -- https://master.php.net/note/delete/107136/integrated Del: useless -- https://master.php.net/note/delete/107136/useless Del: bad code -- https://master.php.net/note/delete/107136/bad+code Del: spam -- https://master.php.net/note/delete/107136/spam Del: non-english -- https://master.php.net/note/delete/107136/non-english Del: in docs -- https://master.php.net/note/delete/107136/in+docs Del: other reasons-- https://master.php.net/note/delete/107136 Reject -- https://master.php.net/note/reject/107136 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#185516) next »