Hi I’m Ali Hassan from Telecom Academy. We have provided you the introduction of PHP MySQL and XAMPP installation. Now we will discuss about the Basic Syntax of PHP. We will use Notepad ++ for writing PHP. Its unique feature is that it contains lining number and you can easily find the error in the code. Other notepad does not contains line number which causes problems on executing the code.
Always remember without HTML setup you can write the PHP code. You can get direct output using PHP. But often you have to use HTML for creating Pages in PHP. We cannot ignore HTML as it is more necessary in important cases for designing the pages.
PHP syntax using NotePad++
Now I’m going to tell you an important tip that there is no rule in PHP that we use the PHP tags after HTML , after Head or After Body,. We can write PHP scripts/tags anywhere we want. But if you have to show the data from the database in a special section. Then you have to write the PHP code in the specific area.
As you can write the PHP code anywhere, following is the Basic Syntax for PHP
<title> Telecom Academy</title>
<meta name=”keywords” content=”Innovation in connecting the world”>
Basic Syntax of PHP contains the PHP starting tag and ending tag. It is written with the less than sign ‘<’ and question mark and ends with the question mark and greater then sign’>’. You can write the PHP code scripts between this Basic Syntax.
This is Basic Syntax of PHP 5. In PHP 4 you can write this syntax without using the PHP tag. But for running PHP important commands above Basic Syntax must be used to execute the commands.
You may also see the
Latest posts by Ali Hassan (see all)
- 22.214.171.124 Packet Tracer – Configuring IPv4 Static and Default Routes - July 3, 2018
- 126.96.36.199 Packet Tracer – Investigating Directly Connected Routes - June 23, 2018
- 188.8.131.52 Packet Tracer – Configuring and Verifying a Small Network - June 22, 2018