PHP for Beginners - Introduction

           

                This post will provide you with a knowledge about the server side scripting language of PHP for Beginners

             A scripting language is a language that interprets scripts at runtime. The purpose of the scripts is usually to enhance the performance for an application.

Introduction to PHP

        PHP stands for Hypertext Preprocessor and it is a server side scripting language that is used to develop Static websites, Dynamic websites and also used for make Web applications. It is the preferred scripting language for tech giants such as Facebook, Wikipedia, and Tumblr despite full-stack JavaScript gaining popularity with upcoming developers. This article will help you know about the various aspects involved in the learning of PHP.

PHP 7 is latest version
 What is the difference between HTML & PHP?

          Now many of you might ask that why do we need PHP when we already have HTML. Unlike HTML, PHP allows the coder to create an HTML page or section of it dynamically. PHP is also capable of taking data and use or manipulate it to create the output that the user desires.

         In HTML, anything you put in creates an output but PHP would not give you an output if something is wrong with your code. The learning curve of PHP is also much steeper compared to HTML.

A PHP script can be placed anywhere in the document.

It starts with <?php and ends with ?>



Syntax
               <?php // PHP code goes here ?>

        Now that you know the basic syntax of PHP, let’s move forward to what are the prerequisites are needed to learn PHP.



Prerequisites to learn PHP

         Learning a new programming language can be a bit difficult for many people. Many people don’t know where to start and give up before they begin. Learning PHP is not as difficult as it might seem. One of the reasons for PHP’s success is that it has really great documentation. One can just dive into the documentation and get started without having any particular set of skills.

       But once you have gained some knowledge in PHP, you will need to learn other languages for using PHP effectively. The languages include:


  • HTML
  • MySQL
  • CSS
  • JavaScript



Why do we need PHP?

         You must be wondering that why do we need PHP for web programming when we already have other scripting languages like HTML.

So let’s move ahead and find out some of the compelling reasons for using PHP:


  •      It is open-source and free scripting language
  •      It has short learning curve compared to other languages such as JSP, ASP etc.
  •      Most web hosting servers support PHP by default
  •      It is a server-side scripting language so you need to install it on the server and client        computers  requesting for resources from the server do not need to have PHP installed PHP has in built support for working hand in hand with MySQL
  • It is cross platform so you can deploy your application on a number of different operating systems such as windows, Linux, Mac OS etc.



Where do we use PHP?

There are three main areas where we use PHP:

Server-side Scripting

        This is the most traditional and main target field for PHP.

     The three things required to make this work include a PHP parser, a web server and a web browser. The web server runs with a connected PHP installation. You can access the PHP program output with a web browser, viewing the PHP page through the server.

Command line Scripting

      PHP script can also run without any server or browser. You only need the PHP parser to use the command line scripting. This type of usage is ideal for scripts regularly executed using cron on Linux or Task Scheduler on Windows. These scripts can also be used for simple text processing tasks.

Writing desktop applications

      PHP is probably not the most preferable language to create a desktop application with a graphical user interface. But if you are well versed with PHP, you can use some advanced PHP features in your client-side applications and also use PHP-GTK to write such programs. You also have the ability to write cross-platform applications this way.

     So far in this series of PHP Tutorial article we have learnt about when and where should we use PHP. 



Keep in touch...

Happy Learning !!!...

Comments

Popular posts from this blog

Foundations of Programming -Introduction to data and data types

Artificial Intelligence

The best programming languages to learn