What is a PHP file?
A file with .php extension refers to open source programming language, used to write server side scripts, to be executed on a web server. It is the most widely used web-scripting language that is typically used for development of large-scale web applications. The biggest blogging system on the web i.e. WordPress and the largest social network Facebook are based on PHP language. It is compatible with various platforms such as Windows, Linux, Unix, Mac OS X, etc. Also it successfully runs on almost all servers used today i.e. Apache, IIS, etc. PHP supports wide range of databases including MySQL.
PHP File Format
A single PHP can contain text, CSS, HTML, JavaScript, and PHP code. PHP code is executed on the server, and the result is returned to the browser as plain HTML. PHP files can be opened with any text editor and edited in place, though applications like Adobe Dreamweaver, Eclipse PHP Development tools offer a convenient way to write and modify PHP code.
Syntax
A PHP script is executed on the server, and the plain HTML result is sent back to the browser. A PHP script starts with
PHP Example
<!DOCTYPE html>
<html>
<body>
<h1>My first PHP page</h1>
<?php
echo "Hello World!";
?>
</body>
</html>