Friday, September 11, 2020

An Introduction to PHP



Hello dear readers! welcome back to another section of my tutorial on PHP. In this tutorial guide, i will be giving a proper indroduction to PHP.

PHP started out as a small open source project that evolved as more and more persons found out how useful it was. The very first version of PHP was lunched in the year 1994 by Rasmus Lerdorf. Following below are the list of advantages for learning PHP -

  • PHP is a repeated acronym for the "PHP: Hypertext Pre-processor".
  • PHP is a server side scripting language that is embedded into Html. It is used to manage dynamic content, databases, session tracking and build entire e-commerce sites.
  • PHP Programming is well integrated with a number of famous databases, including Oracle, PostgreSQL, MySQL, Sybase, Informix, and the Microsoft SQL Server.
  • PHP is zippy in its execution, mostly when it is compiled as an Apache module on the Unix OS. The MySQL server, once started, executes even very complex queries with a large result set in record-setting time.
  • PHP has support for a large number of major protocols such as the IMAP, POP3 and LDAP. PHP4 added support for Java and the distributed object achitectures (COM and COBRA), making n-tier development possible for the first time.
  • PHP is forgiving: PHP tries it best to be as forgiving as possible.
  • PHP syntax is C-Like.


Applications of PHP

As mentioned before, PHP is one of the most widely used language over the web. Following below is the list of few uses of PHP -

  • PHP can perform system functions, i.e. from files on a system it can create, open, read, write, and close them.
  • PHP is capable of handling forms, i.e.gather a data from file, save data to a file, via email you can send data, return data to user.
  • You can add, delete, and also modify elements within your database with PHP.
  • Accept cookie variables and also set cookie.
  • You can restrict users from having access to certain pages of your site through PHP.
  • PHP can be used to encrypt data.


Characteristics of PHP

The following below are the five most important characteristics that makes PHP's practical nature possible -

  • Efficiency
  • Simplicity
  • Flexibility
  • Security
  • Familiarity

RECOMMENDED: An Overview of PHP

A Brief Example of PHP

Just to give you a little excitement on PHP, we are going to give you a small conventional PHP Hello World program.

As mentioned in my last tutorial, PHP is embedded in Html. That means that amongst your normal Html, you are going to have PHP statements like this -

<html>
   
   <head>
      <title>Hello World</title>
   </head>
   
   <body>
      <?php echo "Hello, World!";?>
   </body>

</html>

Output

When the above code is executed, it will produce the following result -

Hello, World!

If you inspect the Html output of the above example, you will find out that the PHP code is not present in the file sent from the Web Server to your browser. All of the PHP code that is present in the webpage is processed and then stripped from the web page. The only thing returned to the client from the Web server is pure Html output.

PHP Inclusion
Every PHP code must be included inside one of the three markup tags. ATE are recognized by PHP Parser.

<?php PHP code goes here ?>

<?    PHP code goes here ?>

<script language = "php"> PHP code goes here </script>

The most commonly used tag is the <?php...?> and we will also make use of this same tag in our tutorial.


Alright guys! This is where we are rounding up for this tutorial post. In my next tutorial post, we are going to be studying about PHP Environment Setup.

Feel free to ask your questions where necessary and i will attend to them as soon as possible. If this tutorial was helpful to you, you can use the share button to share this tutorial.

Follow us on our various social media platforms to stay updated with our latest tutorials. You can also subscribe to our newsletter in order to get our tutorials delivered directly to your emails.

Thanks for reading and bye for now.
Share:

0 comments:

Post a Comment

Hello dear readers! Please kindly try your best to make sure your comments comply with our comment policy guidelines. You can visit our comment policy page to view these guidelines which are clearly stated. Thank you.