Hi tedd,

Saturday, June 16, 2007, 1:18:58 PM, you wrote:

> How about?

> switch (1)
>         {
>         case $allow_fraction:
>         $filter['flags'] = FILTER_FLAG_ALLOW_FRACTION;
>         break;

>         case $allow_thousand:
>         $filter['flags'] = FILTER_FLAG_ALLOW_THOUSAND;
>         break;

>         case  $allow_scientific:
>         $filter['flags'] = FILTER_FLAG_ALLOW_SCIENTIFIC;
>         break;
>         }

> Would that not work?

Sorry but no because it doesn't allow for multiple flags to be set.
It's perfectly valid to have one, two or all three flags active on the
filter_var call. Even if the switch statement was re-run again, it
wouldn't bitwise OR the values together, it'd just replace them.

Cheers,

Rich
-- 
Zend Certified Engineer
http://www.corephp.co.uk

"Never trust a computer you can't throw out of a window"

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to