by shiflet » Sat, 19 Mar 2005 03:32:34
If you put an opening brace after that, you'll get a parse error. You're
also treating andrea and john as constants, which I'm guessing isn't
what you mean. I think you were wanting:
if ($name == 'andrea' || $name == 'john')
If you have a bunch of these conditions, a switch might be convenient:
switch ($name)
{
case 'andrea':
case 'john':
case 'chris':
case 'rasmus':
case 'andi':
case 'zeev':
echo 'The name was one of those';
break;
default:
echo 'The name wasn't one of those';
}
Hope that helps.
Chris
--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://www.yqcomputer.com/