I strongly disagree. Echoing well-formated HTML is much harder than simply tagging around it, and what's the benefit of echoing it? You like escaping characters?
1) your js should be echoing the HTML and getting data through JSON ajax
2) echo and print both work in command line, are explicit and work exactly as any language, whereas peppering your shit with php tags looks like shit and a maintenance nightmare.
If you have trouble escaping characters, you should consider the single quote, it's known to rock the boat.
Additionally, "'.$var.'" is the best, fastest, cleanest no surprise approach to inserting variables in markup, leaving double quotes just fine and dandy inside your markup.
And then, I'm pretty sure I'd rather have a string with 100% warranty of no execution or interpretation (that's single quote versus double quote for me) than any kind of dirty markup polluting my source code.
On the same subject, there is no valid reason for having naked markup inside your PHP, or between PHP tags because you're just begging for problems.
And I would expect multiple PHP tags to cause some minimal parsing overhead too.
Either way this matters not because the only sane way to use PHP in a web application is echo json_encode($return);
or header(file) + readfile
And even then the second example is only there because javascript can't be arsed to support file creation/download (i.e. server -> blob.gz -> js -> would you like to dload this shit ?)
1) your js should be echoing the HTML and getting data through JSON ajax
2) echo and print both work in command line, are explicit and work exactly as any language, whereas peppering your shit with php tags looks like shit and a maintenance nightmare.
If you have trouble escaping characters, you should consider the single quote, it's known to rock the boat.
Additionally, "'.$var.'" is the best, fastest, cleanest no surprise approach to inserting variables in markup, leaving double quotes just fine and dandy inside your markup.
And then, I'm pretty sure I'd rather have a string with 100% warranty of no execution or interpretation (that's single quote versus double quote for me) than any kind of dirty markup polluting my source code.
On the same subject, there is no valid reason for having naked markup inside your PHP, or between PHP tags because you're just begging for problems.
And I would expect multiple PHP tags to cause some minimal parsing overhead too.
Either way this matters not because the only sane way to use PHP in a web application is echo json_encode($return); or header(file) + readfile
And even then the second example is only there because javascript can't be arsed to support file creation/download (i.e. server -> blob.gz -> js -> would you like to dload this shit ?)