Do you know basical php if() condition right? But, my questions is : do you know the short way? If not, I will show you the diferrence,:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
<?php $a=1; $b=3; $c = $a+$b; //THE SHORT WAY COMES print $c == 3 ? "yes $c = 3" : "no $c != 3"; //THE "COMMON" WAY SAME THING if($c ==3) { print "yes $c = 3"; }else{ print "no $c != 3"; } ?> |