Well the question is self explanatory.
In PHP when do I use the if/endif
notation instead of the standard if(something){}
notation?
Exa
Short answer:
Always use if($something) { }
and pretty much never use if/endif
. It's standard since PHP 4.0.0 and while the old syntax is not going away this is the one everybody expects.
If you are really looking for a case where you can use if/endif then it's when using php as a template language.
Some people like something like this:
Hi There
cya!
better than
Hi There
cya!
and imho it is because every line "speaks" and that can be helpful when there is a lot of html inbetween the php tags.