What is the default extension of the PHP file?
The default extension of a PHP file is .php, for example index.php. The web server sends every file with this extension to PHP, which runs the code and sends the result to the browser.
You may see .phtml or .php5 in some old projects, but today .php is used everywhere.
Note:
Never save PHP files like config or include files as .inc or .txt. The server does not run them, so a visitor can open them in the browser and read your code and passwords. Always use .php.
Learn more about the similar topics:
| Tutorials |
|---|
| PHP Introduction |
| PHP Terminology |
| PHP Installation |
| PHP Syntax |
| PHP Comments |
| PHP exit() Function |
| Exercises & Assignments |
|---|
| Write a program to print “Hello World” using echo |
| Simple Tips for PHP Beginners |
| Experiment with Basic PHP Syntax Errors |
| Using phpinfo() – Display PHP Configuration & Modules |