The <php is used to identify the start of a PHP document.
In PHP whenever it reads a PHP document, It looks for:
It process the codes in between the above tags only and leaves the other codes around them.
For example :
Hello PHP !
Note : But a special case is when you write a PHP file the end tag can be omitted, Only the start tag is needed.
The below code works fine as well:
Hello PHP !
The <= tag is called short open tag in PHP. To use the short tags, one must have to enable it from settings in the PHP.ini file.
First of all ensure that short tags are not disabled, To check it, go into php.ini file On line 77 .
(location in linux systems :/etc/php5/apache2/php.ini)
Find the below line in the file and add (On) instead of (Off):
However, from PHP version 5.4.0, the short tags are available for use regardless of the settings in the PHP.ini file.
The below two examples produces the same output with and without short open tags.
Example 1 : Normal Way.
Example 2 : The Short Hand Way.
As you can observe, both of the above codes gives us the same output. So, using short tags we told to php interpreter that:
can be treated same as
The above example can be further modified as follows :
- What purpose does a <script> tag serve inside of a <noscript> tag?
- What does it mean to start a PHP function with an ampersand?
- What is the difference between MEAN.js and MEAN.io?
- What does the “+” (plus sign) CSS selector mean?
- Difference between <article> tag and <section> tag
- Why <big> tag is not in HTML5 while <small> tag exists ?
- PHP | fopen( ) (Function open file or URL)
- How to open a PDF files in web browser using PHP?
- PHP | XMLReader open() Function
- What does $$ (dollar dollar or double dollar) means in PHP ?
- Where does PHP store the error log? (php5, apache, fastcgi, cpanel)
- Why PHP script does not create a directory with 777 permissions ?
- Why does PHP 5.2+ disallow abstract static class methods ?
- Python script to open a Google Map location on clipboard
- Open Source, Freeware and Shareware Softwares
- Open shortest path first (OSPF) - Set 2
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.