What is PHP ? 

PHP means Hypertext Preprocessor. It is open source scripting language. It is a server side language so scripts which is made in PHP are executed on the server. PHP is open source so we can download easily and use in our any project. 


PHP is very powerful language. With the help of PHP we can make any large scale website like Facebook and WordPress. PHP is easy to learn. So beginner can easily learn PHP in very short time and create websites. PHP is very simple for a beginner but it offers many advanced features for a professional programmer. 


what is php


What Does PHP Stand For ?

When PHP was created, PHP's full form was Personal Home Page. But now it is Hypertext Preprocessor. Currently PHP is more commonly used as Content Management Systems(CMS) and Frameworks (Laravel, Codeigniter etc.) which is made form PHP. Core PHP is rarely used.


What is PHP File?

Any file that has an extension .php is called a PHP file. PHP files contain HTML, CSS, JavaScript and PHP code. We can easily embed PHP code in HTML and CSS. When PHP file is executed on the server then PHP code is also executed and we get plain text on our browser screen. Which means we can't see PHP code on client side. 


What Can We Do With PHP ?

 Mainly these things can be done with PHP:

Server side scripting:

PHP is mainly used for server side scripting. To do this, we mainly need three things. The first of these is PHP parser, the second Web server and the third Web browser.
First of all we have to install PHP on our web server and then run the Web server. After that we can see the output with the help of Web browser.

Command line scripting:

We can run PHP script without any server and browser. For this we need PHP parser. With the help of Cron (in Linux) and Task scheduler (in Windows), we can run any script continuously.

Desktop Applications:

With the help of PHP, we can create a desktop application. We will need PHP-GTK to create this type of application. PHP-GTK is an extension of PHP that is used to create cross platform applications. PHP is not exactly the right language for making such applications, if you still want to create a desktop application with the help of PHP, then you should be well aware of the advance features of PHP. Only then you will be able to create this type of application. Nowadays there is a lot of language and technology available in the market to make desktop application, you can also go with them. PHP is specifically designed for web development.

Along with these, we can do the following from php:

  • We can generate multi number of dynamic pages with PHP.
  • We can encrypt and decrypt data easily with PHP. With this help, we can protect our data.
  • We can create, read, write, open, close and delete files on the server.
  • We can collect data from many types of forms and keep them in our database.
  • We can send and receive cookies with PHP.
  • We can perform CRUD (Create,Read,Update,Delete) operations on data which is store in our database.
  • We can control user access on some level. For example if user sign out of his account, then without login he will not be able to use his account. 
  • We can send and receive cookies with PHP.
  • With the help of PHP we can output HTML, images, PDF files and videos. We can also output XML and XHTML. With this, we can easily create xml-sitemap for our website.


Why Do We Use PHP ?

There are  many reasons behind the use of  PHP. Which we are discussing further:

  • PHP is absolutely free. So we can easily download it from php's official website:  www.php.net.
  • PHP is quite simple to learn and can be easily setup on the server.
  • PHP can be used with most types of databases Like mysql, PDO.
  • PHP can be configured with almost all servers currently in use Like Apache, Nginx, IIS.
  • PHP can be used with all operating systems Like Unix, Linux, Windows and Mac OS.
  • With PHP we have the choice of using procedural programming or object oriented programming(OOPS) or use both.
  • PHP can be used with other services using some protocols like LDAP, HTTP, POP3, IMAP etc.


Example of PHP Code

<!DOCTYPE html>
<html>
<head>
<title>PHP Example - CodexRadar</title>
</head>
<body>

<?php
echo "Hello World!";
?>

</body>
</html> code-box


Output:

Hello World! alert-info


Summary

Now you know what is PHP?  We will continuously publish posts on PHP and keep you updated. You can subscribe to our blog so that you can get all the information related to new technology and you can keep yourself updated.

Post a Comment

Previous Post Next Post