Question: I'm doing some validation now in PHP, and I'm running allot of conditional statements, for example:

```

if ($this->email->isValid($email))
return false;
if ($this->username->isValid($username))
return false;

```

ect.. 

Is there a nice way to do this? Or do I just run ten If statements like the ones above?
I can't use `switch` obviously, but I'm looking for that type of solution.. 

P.S... I'm using Zend Framework for validation

Answer: 
You could OR them like this:

```
if(cond1||
   cond2||
   cond3||
   cond4)
{
  return false;
}

```
If this is data from a form, take a look at Zend\_Form, as recommended by a poster in your [other question](https://stackoverflow.com/questions/981094/recommendation-for-a-php-validation-framework/981113#981113)

I posted some [example code](http://pastebin.com/m3a0b3857) which details adding validators to form elements