Product first, then polish.
Get your site/application/game doing what it's supposed to do. Get it up and running, and get people interested.
Then, when you have the time, go back and polish it up. But only because you care, not because anybody else does.
Of course, if the non-compliance issues mean people can't view it, or it's unreadably ugly, or it takes a month to load, or it's hard to maintain, or it crashes the browser, this is a major problem. But it would still be a major problem even if you were standards-compliant.
Ordinary users do not look at the source for a website that isn't loading and go, "Well, it's not displaying the pictures, but it's completely W3C-compliant". They simply browse to another website and never return.
Bottom line, standards are there to make writing browsers easier, and to close up potential security holes. Amazon, Penny-Arcade and Stack Overflow do not make their money from running a standard-compliant website. And unless you're in a website-writing competition, neither will you.
What about:
Neither
Mixing languages is not a good idea. You don't put JavaScript in HTML, or HTML in JavaScript, or JavaScript in PHP, or HTML in Python or Ruby in SQL.
Why don't we do that?
Because different languages usually correspond to different layers.
PHP deals with business logic. HTML deals with presentation of the business objects. Thus, you have two layers: the one generates the objects; the other one builds a pseudo-XML representation of those objects.
In the same way, JavaScript deals with interaction, and CSS with the presentation of the content. When you want to change interaction, you don't open an .html file, and you surely don't open a .php file: you open a .js or .coffee file.
By mixing logic within the same file, you'll quickly notice that maintaining the code becomes more and more difficult. You want to change the method which applies rebates to products, and you spend fifteen minutes browsing through a mix of HTML with PHP statements here and there, and PHP code with HTML all over it.
The fact that technically, PHP makes it possible to mix HTML and PHP is irrelevant. The feature is available for historical reasons, but shouldn't be used any longer.
So what should you do?
What are you probably looking for is called templates. Depending on the framework you use, it may already be available, usually under a form of MVC, where the template is in the view, or you may have to use a third-party template engine, such as Smarty.
In both cases, the idea remains the same. You have PHP code strictly separated from the template which contains the HTML and a bit of very simplistic logic: simple loops over entities, conditions for conditional displaying of information, etc. When the PHP code is ready, it calls the template engine, passing to it some information. The engine uses a specific template to build the final output (often HTML, but other formats are possible as well) which is then sent to the user.
By using templates, you make sure that you have a strict separation between the business logic and the form you give to this logic through the templates. One day, you can throw all those templates and write other ones, without modifying a single line of PHP code. Or you may create a bunch of templates for a mobile version of the website.
An additional benefit is that you are not even stuck with HTML. If you need to make an API which is based practically 1:1 on the actual web pages of the website, instead of applying the template, you serialize to JSON the object which was about to be sent to the template engine. With practically zero efforts, you add API capability to an app, thing which couldn't be possible without severe rewriting if you were mixing PHP and HTML.
Best Answer
As comment points out, it should be done by templates. But if only your two choice is possible. Case 1 will be better. This is the same concept as android inflating layout by xml , or programmaticlly making the UI. Your
<br/>
is a static content from your html and all your server will be doing is to show it. But if you use php, to execute it, this will be using your servers resources and be computing.This is how it should be done: index.php:
header.html and footer.html are templates.