PDA

View Full Version : make a whole if statement on one line


Dimava
Sun 19th May '02, 7:43pm
is is possible to put this whole text onto one line?


if ( $category == '1' ) {
$one = $one + 1;
}


thanks

Dimava

Mark Hensler
Sun 19th May '02, 8:58pm
It would have taken you 5 seconds to try it, and 10 to find it in the manual.

if ($category == '1') $one = $one + 1;

Dimava
Sun 19th May '02, 9:14pm
lol ok thanks

rylin
Mon 20th May '02, 12:03pm
Originally posted by Mark Hensler
It would have taken you 5 seconds to try it, and 10 to find it in the manual.

if ($category == '1') $one = $one + 1;
if($category == 1) { ++$one; }
;)