Preg Match Problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, 

I have a code snippet here as in the following:

[CODE]
$keywords = preg_split("/[\s,]+/", $day);
$count = count($keywords);
  if(preg_match("(Mon|Tue|Wed|Thu|Fri)/i", $keywords[$i])) { //line 40
   $day_query ="start_time.day='12345' AND end_time.day='12345'";  
   }  
   if(preg_match("Sat/i", $keywords[$i])) { //line 43
   $day_query = "start_time.Sat_route != 'NULL' AND end_time.Sat_route != 'NULL'";
   }  
   else {
   echo $keywords[i] . " is not a term that exists in the database. Make sure the pattern looks like <b>Mon, Tue</b><br />";
   footer();
   exit;
   }
[/CODE]

For some reason, when I type in Mon, Tue

It gives me this: 

Warning: preg_match() [function.preg-match]: Unknown modifier '/' in line 40
Warning: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash on line 43
is not a term that exists in the database. Make sure the pattern looks like Mon, Tue

Have I done something wrong here?
Thanks for your help.
 		 	   		  
_________________________________________________________________
Hotmail is redefining busy with tools for the New Busy. Get more from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux