Hi friend,
This is very simple when you want to mix html and php but you don't want to use echo or print. Then what you do is encapsulate the html inside a php if-else block or foreach or for block like this
<?php if (isset($_SESSION['user'])) : ?>
<!--
<?php else : ?>
<!--
<?php endif; ?>
This way instead of using something cumbersome like this :
<?php <br mode="hold" /?> if (isset($_SESSION['user'])) {
echo '<!--';
else
echo '<!--';
}
?>
In this very small example, the code below seems simple but when you start to put real tags and links inside these echo methods, the whole code become dirty and unreadable very soon.
So, it is a better method to use the former way of coding to generate more clean and readable code. It simple has no big effect on code running time etc.
If, this is the answer you need then, please do mark it as solved :)
With Regards
Tushar Srivastava