in reply to Logical Not not working!!!

Not sure why you have three outputs on the first line and only two on the second, but nevermind.   Just use $array[$i] = ($array[$i] ? 0 : 1);

This is the sort of “problem” that just is not worth pulling out hair over.   “Don’t bother to ask Why.   Just write Something That Works, and that is reasonably clear to you and to your successor, and move along.”

Replies are listed 'Best First'.
Re^2: Logical Not not working!!!
by baski (Novice) on Aug 20, 2010 at 21:42 UTC
    Thats the output..its not printing anything when i try to print !1, but ya..I think the james2vegas's explanation that 1 is negating to " " makes sense...Thanks for replying