|
|
reducing if else code - lesser code lines - PHP
|
Views : 248
|
|
Tagged in : PHP
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
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 );
|
|
By rajesh, On - 2010-01-17 |
|
|
|