even if you have only 1 character PHP, you still need to have it end with .php
Otherwise it will not go tru the PHP parser, and all your (secret) PHP coding will be visible to the user (in some cases).
Also, for the the headers i talked about, should be in php, like:
<?php
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Pragma: no-cache');
?>
PHP is not visible to the browser.
if you create this:
<body>
<p>
Hello, this is just a phptest <br />
to show you php code is not visible<br />
<?php
$a = "this ";
$b = "is a ";
$c = "test";
echo $a . $b . $c;
?>
</p>
<p> See? </p>
</body>
Now, if you look at the SOURCE in your browser, you will not see the phpcoding, you will only see 'this is a test </p>'
That is why you need the extention .php, so the server knows there is some work to do, before the page can be submitted to the browser.
Javascript in the other hands, works on your own machine. so javascript can be seen in your source
edit: i should type faster 😛