Basically, a PHP file is a text file with the extension .php which consists of:
To work with PHP you need to know HTML but we are going to generate dynamic web pages with PHP. PHP is not difficult! On the contrary, PHP is often very similar to plain English.
Let's get started with your first PHP page.
Example1: Hello World!
Start by making an simple HTML document, but name the file index.php and save it in the root of the site:
The HTML code should look like this:
<title>My first PHP Hello World page</title>
Now, we need to tell the server when the PHP will start and end. In PHP scripting language you use the tags <?php (start) and ?> (end) to mark the start and end of the PHP codes that the server must execute.
Now try to add the following simple code snippet to your HTML code