PHP

Posted by soorya on March 14th, 2019

PHP started out as a small open source project that evolved as more and more people found out how useful it was. Rasmus Lerdorf unleashed the first version of PHP way back in 1994.

  • PHP is a recursive acronym for "PHP: Hypertext Preprocessor".

  • PHP is a server side scripting language that is embedded in HTML. It is used to manage dynamic content, databases, session tracking, even build entire e-commerce sites.

  • It is integrated with a number of popular databases, including MySQL, PostgreSQL, Oracle, Sybase, Informix, and Microsoft SQL Server.

  • PHP is pleasingly zippy in its execution, especially when compiled as an Apache module on the Unix side. The MySQL server, once started, executes even very complex queries with huge result sets in record-setting time.

  • PHP supports a large number of major protocols such as POP3, IMAP, and LDAP. PHP4 added support for Java and distributed object architectures (COM and CORBA), making n-tier development a possibility for the first time.

  • PHP is forgiving: PHP language tries to be as forgiving as possible.

  • PHP Syntax is C-Like.

    Common uses of PHP

    • PHP performs system functions, i.e. from files on a system it can create, open, read, write, and close them.

    • PHP can handle forms, i.e. gather data from files, save data to a file, through email you can send data, return data to the user.

    • You add, delete, modify elements within your database through PHP.

    • Access cookies variables and set cookies.

    • Using PHP, you can restrict users to access some pages of your website.

    • It can encrypt data.

    Characteristics of PHP

    Five important characteristics make PHP's practical nature possible −

    • Simplicity
    • Efficiency
    • Security
    • Flexibility
    • Familiarity
  • In order to develop and run PHP Web pages three vital components need to be installed on your computer system.

    • Web Server − PHP will work with virtually all Web Server software, including Microsoft's Internet Information Server (IIS) but then most often used is freely available Apache Server. 

    • Database − PHP will work with virtually all database software, including Oracle and Sybase but most commonly used is freely available MySQL database. 

    • PHP Parser − In order to process PHP script instructions a parser must be installed to generate HTML output that can be sent to the Web Browser. This tutorial will guide you how to install PHP parser on your computer.

      The main way to store information in the middle of a PHP program is by using a variable.

      Here are the most important things to know about variables in PHP.

      • All variables in PHP are denoted with a leading dollar sign ($).

      • The value of a variable is the value of its most recent assignment.

      • Variables are assigned with the = operator, with the variable on the left-hand side and the expression to be evaluated on the right.

      • Variables can, but do not need, to be declared before assignment.

      • Variables in PHP do not have intrinsic types - a variable does not know in advance whether it will be used to store a number or a string of characters.

      • Variables used before they are assigned have default values.

      • PHP does a good job of automatically converting types from one to another when necessary.

      • PHP variables are Perl-like.

      PHP has a total of eight data types which we use to construct our variables −

      • Integers − are whole numbers, without a decimal point, like 4195.

      • Doubles − are floating-point numbers, like 3.14159 or 49.1.

      • Booleans − have only two possible values either true or false.

      • NULL − is a special type that only has one value: NULL.

      • Strings − are sequences of characters, like 'PHP supports string operations.'

      • Arrays − are named and indexed collections of other values.

      • Objects − are instances of www.fita.com programmer-defined classes, which can package up both other kinds of values and functions that are specific to the class.

      • Resources − are special variables that hold references to resources external to PHP (such as database connections).

       

Like it? Share it!


soorya

About the Author

soorya
Joined: March 14th, 2019
Articles Posted: 1