Re: One variable not equal to 2 values.
| From: | Robert Cummings | Date: | Thu, 25 Sep 2003 23:49:08 +0000 |
| Subject: | Re: One variable not equal to 2 values. | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-164009@lists.php.net to get a copy of this message | ||
On Thu, 2003-09-25 at 19:49, Curt Zirzow wrote:
> * Thus wrote Ed Curtis (ed@homes2see.com):
> >
> > How would I write this statement:
> >
> > if $thisvar is not equal to this value or that value. { do stuff }
> >
>
> Ok. I have to throw this in for historical purposes :)
>
> switch ($thisvar) {
> case 'thisvalue':
> case 'thatvalue':
> break;
> default:
> // do stuff
> break;
> }
*grin* here's another:
if( $thisvar == 'this value'
? false
: ($thisvar == 'that value'
? false
: true) )
{
// do stuff.
}
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com
|
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'