My further 1 cent in addition to ahref's 2 cents
Its not the server that treats PHP, its the PHP interpreter that does the job!! Here's the over-simplified sequence.
- A browser sends a request for a file to the server.
- If its .php file, Apache calls in PHP interpreter for help and hands over the file to it.
- PHP interpreter goes thru the file and processes everything thats within <?php and ?> tags. However, it doesn't do anything to the code thats outside those tags.
- Apache once again takes over the output give by the interpreter and hands it over to the browser which is dumb enough to understand only HTML and Javascript.
- If the browser is IE, it will render even a W3 standard compliant page erroneously. If the browser is not IE, it is more likely that the page is rendered correctly
I would also like to point out that PHP can be used anywhere on the page whether it be <head> or <title> or whatever!! For example, based on certain criterion, it can even me made to select a differnt external CSS files or change the title of the page. Here's a small simple example.
PHP:
<html>
<head>
<title>
<?php
$myid = $_GET["identity"];
if ($myid == "one")
print("This is the my favourite page tite");
else
print("This is the default page title");
?>
</title>
</head>
<body>
</body>
</html>
So start thinking a little differently. You can use break-away from static code anywhere with just the <?php and ?> tags. All that you need is .php extension to the file.