[FX.php List] PHP question

Leo R. Lundgren leo at finalresort.org
Thu Jan 14 07:26:47 MST 2010


Add a space to the regex :)

Also not that this checks for "hall" as well as "Hall" in the end.


14 jan 2010 kl. 15.22 skrev Gareth Evans:

> A preg_match will work.
>
> if (isset($_POST['Department_Name']) && preg_match('/hall$/i’,  
> $_POST['Department_Name']) {
> -- 
> GARETH EVANS
>
>
> > From: "VanBuskirk, Patricia" <pvanbuskirk at otc.fsu.edu>
> > Reply-To: "FX.php Discussion List" <fx.php_list at mail.iviking.org>
> > Date: Thu, 14 Jan 2010 09:19:24 -0500
> > To: "FX.php Discussion List" <fx.php_list at mail.iviking.org>
> > Subject: [FX.php List] PHP question
> >
> > This is probably an easy one, but I cannot think this morning!  In  
> PHP,
> > if I wanted to see if the contents of a field end with something,  
> how
> > would I word it?
> >
> >
> >
> > Ie. If the Department Name ends in " Hall" (Landis Hall, Bryan Hall,
> > etc), then do this...
> >
> >
> >
> > Here's what I'm trying and it is not working:
> >
> >
> >
> > if (isset($_POST['Department_Name']) && $_POST['Department_Name']  
> == "*
> > HALL") {
> >
> >
> >
> > Thanks,
> >
> > Trish
> >
> > _______________________________________________
> > FX.php_List mailing list
> > FX.php_List at mail.iviking.org
> > http://www.iviking.org/mailman/listinfo/fx.php_list
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



-|

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20100114/16c6312b/attachment.html


More information about the FX.php_List mailing list