[FX.php List] PHP question

Gareth Evans gareth.evans at schawk.com
Thu Jan 14 07:22:46 MST 2010


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

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


More information about the FX.php_List mailing list