Code: <?php // PHP first! $message = "Hello World"; $HTML = " <html> <head> <title>My First PHP Page</title> </head> <body> $message </body> </html>"; // all done echo $HTML; ?> How's there any advantage for doing that instead putting the stuff into a variable then just adding in an echo in the middle of your html? I know on several occasions you've mentioned that you should do all your php before you output anything. Is there any advantage to doing this? The very first bit of code you wrote works... why is there anything wrong with it? (I'm not saying we should all not use doctypes and not use semi-colons in Javascript, but this is different...)
<?php // PHP first! $message = "Hello World"; $HTML = " <html> <head> <title>My First PHP Page</title> </head> <body> $message </body> </html>"; // all done echo $HTML; ?>