In this article, we are going to see this article from a beginners’ point of view.
WHAT?
PHP is the abbreviation of “Hypertext Processor”. This is an open-source scripting language which is completely free and very popular for executing server-based applications. By using this scripting language, we can make dynamic as well as interactive web pages.
Facebook is the best example of PHP. So, in brief, we can say that PHP is the Server Side Programming Language.
WHY?
PHP can run on different platforms like Windows, Linux, Unix, Mac OSx etc. PHP is suitable with the modern servers, such as Apache, IIS and many more. Not only these but PHP supports huge databases too.
SET UP PHP ON YOUR PC
Download from the official PHP resource: www.php.net
However, if your server does not support PHP, go through this.
- Install a web server
- Install PHP
- Install a database, MySQL
The official PHP website (www.php.net) contains the instructions to install PHP - http://php.net/manual/en/install.php
HOW TO WRITE PHP SCRIPT
NOTE - The programmer should have basic knowledge of HTML, CSS, and JavaScript.
SYNTAX 1
We will move on with the latest version of PHP 7 which is quite popular and compatible among the end-users.
We will start scripting in PHP like <?php and ends with ?>
- <?php
- // Code over here
- ?>
Let’s have an example.
- <html>
- <body>
- <?php
- echo "My first Blog!";
- ?>
- //Output is My first Blog!
- </body>
- </html>
echo
This is the inbuilt function of the PHP script, which is used to print the output text. We can say that it is a language construct.
Remember that a PHP statement ends with a semicolon (;).
This is standard type of scripting in PHP.
SYNTAX 2
With using HTML <script> tag.
Let’s have a quick look with examples.
- <html>
- <body>
- <script language=”php”>
- echo "My first Blog!";
- </script>
- //Output is My first Blog!
- </body>
- </html>

Onkar SharmaPosted Oct 6, 2019, 5:21 AM
Nice article, it's very useful for beginners.
Ankur MistryPosted Jul 26, 2019, 8:55 AM
Great work Dipa Mehta many congratulations.
Priyanka JainPosted Jul 25, 2019, 1:01 PM
Nice explanation
Aakash MauryaPosted Jul 25, 2019, 9:44 AM
Great start....