[eluser]jedd[/eluser]
[quote author="Choo" date="1239557874"]And why? Speed? One echo instead of several? OK, it's true, but as for me it's really uncomfortable to write long HTML fragments such way and I prefer mixing.[/quote]
There's an article [url="http://www.e-gineer.com/v1/articles/php-hackers-paradise.htm"]at hacker's paradise[/url] that concludes there may be a benefit from inlining your HTML, but then goes on to say that it's a trivial performance benefit.
You'd have to read up on the PHP method - I forget the syntax, and because it's denoted by a : it's a bit tricky to google for.
But really, to answer your question - I prefer to have blocks of echos in my foreach statments in preference to raw HTML for two reasons. First, as I mentioned, I find it more readable. I actually meant to say that I'm in the minority on that one, but nonetheless...
Second, and quite relevant here, I find I make less mistakes - and those I do are easier to spot - than when I do what you were doing when you got caught out with the above PHP syntax problem.
Your call.