[FX.php List] PHP question
VanBuskirk, Patricia
pvanbuskirk at otc.fsu.edu
Thu Jan 14 07:29:48 MST 2010
Thanks guys! Can it look for a space in front of it as well, so I
wouldn't get anything that just contained the letters "hall" ... in
other words, just find the WORD "Hall"?
From: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Leo R.
Lundgren
Sent: Thursday, January 14, 2010 9:27 AM
To: FX.php Discussion List
Subject: Re: [FX.php List] PHP question
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/3ef85b97/attachment-0001.html
More information about the FX.php_List
mailing list