if statement
I always seem to forget how the short if statement is working in PHP so here it is for a future reference.
Normally you should write it like this in code
if(a == b){ echo “a”; }else{echo “b”;}
There is also a possibility to write this much faster like so:
(a == b) ? echo “a” : echo “b”;
Isn’t that a lot easier.
To be completely correct don’t use {} in the template files. You might rather use something like this:
if(a==b): echo “a”; else: echo “b”; endif;
Same for foreach where you will use foreach(): and endforeach;
Newsletter
If you want to be up to date on the important things, related to the topics I talk about, events and the book I'm writing, please subscribe.
Upcoming Events
- March 8, 2012 6:00 pm'Scrum in practice 2012' Training Session n°3
- March 12, 2012Belgium Testing Days 2012
- April 19, 2012 6:00 pm'Scrum in practice 2012' Training Session n°4
Link to Calendar




