why is there different syntax same outcome?
- by Lizard
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? Its alot more annoying to have to write that out each time.
What are your thoughts?