in reply to Re: Correct Syntax
in thread Need help getting correct syntax for "if" statement

or you could do..
$flag = (index( $f1,'1') == -1) ? 0 : 1;
Dumps the extra "$flag"s and the negative conditional. Actually uses the returned value from the ternary.

Replies are listed 'Best First'.
Re: Re: Re: Correct Syntax
by Anonymous Monk on Aug 11, 2002 at 06:12 UTC
    $flag = 0+(index( $f1,'1') != -1)