On Wed, June 13, 2007 8:13 am, Richard Davey wrote:
> Hi all,
>
> Can anyone think of a more elegant way of achieving the following?
>
> <?php
> $flags = array();

$flags = 0;

>
> if ($allow_fraction)

//Should we warn you that $allow_fraction is not actually defined?...
//You don't have register_globals on, do you?

> {
>     $flags[] = FILTER_FLAG_ALLOW_FRACTION;

$flags |= FILTER_FLAG_ALLOW_FRACTION;

> if (count($flags) > 0)

if ($flags > 0){

> {
>     $c = '$c = ' . implode('|', $flags) . ';';
>     eval($c);
>     $filter['flags'] = $c;

$filter = $flags; // :-)

> }
> ?>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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

Reply via email to