In order for a web browser or server to process php code, your page must have a [ .php ] extension.
Instead of: my_webpage.html
Name it: my_webpage.php
Now let’s create a basic PHP script. Open your favorite HTML editor and create a new web document. Remember to save it as a .php extension to make sure it will process correctly.
Place the following code into the document, save it, and open it using a browser:
The PHP tag opening and closing makes a nest, or more properly termed “block”. Represented in many HTML editors as a block. There are several ways to open and close a PHP block.
Here are the examples of the ways you can script a PHP block’s opening and closing tags:
The standard type tag will work on any server configuration with PHP installed. To allow short tags to work on in your scripts if they do not already by default, you must configure your php.ini script on server.
Inside of php.ini you just add this line to enable short php tag usage:
short_open_tag = On;