For the most part, when I want to display some kind of HTML that will actually display, I would use the "close PHP" tag, write HTML, and then open PHP again. eg,
<?php <p>HTML that I want displayed</p> <?php
But I saw a lot of people who would just use an echo instead, so they would do something like
<?php
Is any performance good for falling and vice versa? I would suggest that this is not the way the PHP engine should handle the entire file anyway.
How about when you use the echo function so that the dose does not look like a function, for example
echo "<p>HTML that I want displayed</p>"
I would hope that this is purely a matter of taste, but I would like to know that I am missing something. I personally find the first method to be preferable (crowding out PHP and then back), because it helps to make a clear distinction between PHP and HTML, and also allows you to use code highlighting and hint at your HTML, which is always convenient.
performance php echo
thecoshman
source share