Today we discuss PHP based topic like What is PHP, Why PHP, Difference between scripting languages and other language, What is a scripting language?, PHP Market share and usage and simple example.PHP is a Hypertext pre-processor. It’s a most popular scripting language on the web. It is widely used in open source source general-purpose scripting language and server side scripting language.
What is a scripting language?
Difference between scripting languages and other languages
|Programming language||Scripting language|
|Has all the features needed to develop complete applications.||Mostly used for routine tasks|
|The code has to be compiled before it can be executed||The code is usually executed without compiling|
|Programming languages may have more traditional structures and more concerns to address.||Scripted languages may tend to be easier to learn, and can take less code to get something done.|
|Does not need to be embedded into other languages||Is usually embedded into other software environments.|
|Programming languages on compilation make binaries||The scripting language does not create any binary files (executables) and no memory will be allocated.|
What is PHP
PHP is a server side scripting language and it’s mainly used for web application.
- Server side scripting language
- Free/ Open Source
- Hypertext Preprocessor
- Web Applications Development
It is a general purpose server side scripting language that is used to develop:
- Web applications
- Dynamic websites
- Static websites
The client computers accessing the PHP scripts require a web browser only. A PHP file contains PHP tags and ends with the extension “.php”. The diagram below shows how a PHP file looks like.
echo 'Welcome to PHP Script';
The flowchart diagram shown below illustrates the basic architecture of a PHP web application and how the server handles the requests.
- PHP is open source and free.
- PHP is regular updated to keep abreast with the latest technology trends.
- Large community document
- PHP is cross platform
- Short learning curve compared to other languages such as JSP, ASP etc.
- Most web hosting servers support PHP by default unlike other languages such as ASP that need IIS. This makes PHP a cost effective choice.
- PHP has in built support for working hand in hand with MySQL; this doesn’t mean you can’t use PHP with other database management systems. You can still use PHP with
- MS SQL Server
PHP Market share and usage
There are over 20 million websites and web application on the internet developed using PHP scripting language. PHP is very simple easy to understand and very helps to develope web applications.
Benefits of PHP
- PHP is an open source software
- It’s a free software. Free to download and use.
- The PHP script execute on server. Because it’s a server side scripting language.
- It runs on various platform like windows,linux,mac etc.
- Italso support wide range of database
The PHP file save with .php extension. Older PHP file extensions include
PHP was designed to work with HTML, and as such, it can be embedded into the HTML code.
<HTML><PHP CODE></PHP CODE></HTML>
You can create PHP files without any html tags and that is called Pure PHP file. Using
<?php … ?>
First PHP Program
The program shown below is a basic PHP application that outputs the words “Welcome to PHP”
echo "Welcome to PHP";
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.