Extensions


PHP File Extensions

File and Tags extension To be sure to save the server with the ".php" suffix in order to recognise our PHP files and scripts. Older extensions to PHP files include –

  • .phtml
  • .php3
  • .php4
  • .php5
  • .phps

PHP has been developed to work with HTML and can be integrated into the HTML code.

Without html tags, you can create PHP files called Pure PHP.

The server interprets the PHP code and results on the web browser as HTML code.

The PHP code must always be included in the PHP tags for a server to differentiate the PHP code from HTML code.

A PHP tag begins with a smaller symbol and a question mark, followed by "PHP."

"VAR" is not the same as "var," PHP is a case sensitive language.

The PHP tags alone are not case sensitive, but a case letter is strongly suggested. This is shown in the code below.

<?php … ?>

The PHP code lines are referred to as statements. PHP declarations conclude with a half colon (;). You can omit the semi-colon if you have only one statement. You must conclude each line with a semi-colon if you have more than one sentence. It is advisable that you always finish your statement(s) with a semi-colon in order to be consistent. The server runs PHP scripts. The output shall be returned as HTML.