If you've ever tried to view the source of a PHP file from your web browser, you may have been surprised to see no PHP code. This is because all the PHP is executed on the server before it is sent to your browser. All your browser ever receives is the results of the PHP.
For this same reason, you cannot go to a .php file on the web, save it, and expect to see how it works. You are only saving the page produced by the PHP, and not the PHP itself.
Here is an example:
Echo "My PHP Page";
We can see that the PHP code is echoing the line My PHP Page
, however, it is the server that reads this code and then knows to send My PHP Page
to your browser. Since the rest of the code is just instructions for the server, it dosen't send anything else. So a view source or a save will simply be the text My PHP Page
, that was sent to the browser from the server when it read our file.