reducing if else code - lesser code lines

by rajesh 2010-01-17 11:59:01

In general we write if else as
if ($a) {
print $b;
}
else {
print $c;
}


this can be done in one line as
print ( $a ? $b : $c );

Tagged in:

646
like
0
dislike
0
mail
flag

You must LOGIN to add comments