PHP files are same as a HTML files, but they can contain both HTML and PHP code. The PHP code is executed by the Web server when the page is accessed, output is written as HTML within the Web page. When a user accesses a PHP page, his Web browser only gets sent the HTML code, since the Web server has processed the PHP code in the background. Most PHP pages are processed so fast that it does not distinctly slow down the loading of the Web page.
The .php extension is essential, since it tells the Web server page may contain PHP code. Then, it should be run during the server's PHP engine earlier than being sent to a client's Web browser. This permits dynamic content to be produced each time the Web page is loaded based on the variables added in the PHP code.



Reply With Quote
Bookmarks