<?php
$me="geek";
echo $me;
echo "<br/>";
echo "Hi";
?>
or
<?php
$me="geek";
echo $me;
?>
// then put the break as HTML outside the PHP code,
<br/>
// and then complete the code with another <?php tag:
<?php
echo "Hi";
?>
<?php
$me="geek";
echo $me;
echo "<br/>";
echo "Hi";
?>
or
<?php
$me="geek";
echo $me;
?>
// then put the break as HTML outside the PHP code,
<br/>
// and then complete the code with another <?php tag:
<?php
echo "Hi";
?>
I don’t think it matters a lot, but I do know it would get insanely annoying to break up your php blocks for some html text and make your code really awful to look at or handle.
The one with 1 echo statement will perform the fastest.
Did you try? Did you notice a difference? If you did, try again
Maybe if you would execute that piece of code thousands of times…
In my test with Apache Bench, I can get ~600 requests per second from the first form, whereas I can only get ~300 requests per second from the second way you have it there.
I don’t remember if PHP flushes the output buffer when it encounters an HTML token, but if it does I’m sure that’s got something to do with the difference.