Why is there different syntax same outcome?
For example
# Example 1
if($myCondition == true) :
#my code here
endif;
if($myCondition == true) {
#my code here
}
# Example 2
foreach($films as $film) :
#my code here
endforeach;
foreach($films as $film) {
#my code here
}
Also I have been using <?=
for ages now and I now understand that is deprecated and I should be using <?php echo
Is this the case and why? It's a lot more annoying to have to write that out each time.
What are your thoughts?