Skip to main content

PHP Basic Concept

What is PHP?
PHP stands for "Hypertext processor" and was initially called "personal home page". PHP does not charge users, hence it is free to download and use. PHP is designed for web use as a scripting language and works only with web server. Examples are: Apache, IIS, nginx etc. which means that the PHP script only runs in web servers.
It is an HTML-embedded scripting language.

Syntax
The opening and closing tags of PHP syntax includes:
Opening tags:
<?php
<?
<script language='php'>
Closing tags:
?>
?> (short tag)
</script>
Note: To use syntax 2 of the closing tags, short tags must be turned "on" in php.ini located at the php.ini file.
To turn this on use: short_open_tag=on

PHP file
The extension of PHP file is (.php). The PHP files contains codes from html, css, java script, user text and php code.
The method of code execution in PHP is called "sever side code" but when the code is executed in a browser it is called "client side code".
Note: Every PHP statements must end with semi-colon (;)

How PHP works?  
The PHP parser will find the requested file and would scan it into PHP codes. After the file has been scanned into PHP codes, the parser will execute the code and send the output to the web server. At this point the web server sends the outputs to the web browser which will display the outputs on the screen.

Evolution of PHP 
PHP was created by Rasmus Lerdorf in the year 1994, but was released to the general public in the year 1995 and was called PHP Version 2.
In the year 1997, two more developers, Zeev Suraski and Andi Gutmans along with Rasmus Lerdorf rewrote PHP and in June 1998, they released PHP Version 3.0.
From then, other versions were created and released; they include:

  • PHP 4 released in May 2000
  • PHP 5 launched in July 2004

Advantages of PHP 

  1. It is easy to learn. 
  2. It is fast. 
  3. It is free (no charges attached). 
  4. It runs on so many operating systems, which include:
  • Windows 
  • Mac
  • Linux
  • Unix
  • Solaris
5. It is designed to support database:

  • MS-SQL
  • IBM DB2
  • MYSqL
  • Oracle
  • Postgre SQL
  • SQLite
6. It is secure and reliable

PHP comments 
Just like commenting in programming, so as users can comment in PHP. A comment is simply a statement, that is ignored by the PHP engine when executing the programme.
The below statement shows how to comment in PHP.

<?php
// This is a single line comment
# This is also a single line comment
/*
This is a multiple line comment
This is a multiple line comment
*/
?>

Comments

Popular posts from this blog

Schrodinger equation as a law in physics

The unified theory of wave-particle duality has been used to derive the Schrödinger equations. The Schrodinger equations are generally accepted, by postulate rather than derivation, to be laws of physics. The Schrodinger equations provide a basis for analyzing many kinds of systems (molecular, atomic, and nuclear) in a particular inertial reference frame. The success of the Schrödinger equations constitutes a basis for accepting them, their derivations, and the unified theory of wave-particle duality which makes such derivations possible. This acceptance is completely justified in the favored inertial reference frame. In accord with the principle of relativity, all physical laws must be the same in all inertial reference frames, i.e., all physical laws must be Lorentz invariant. Recall, the relationship: $$\nabla^{2} \psi = \frac{\partial^{2} \psi}{\partial t^{2}}$$ ...........(1) Equ (1) is Lorentz invariant and reduces, by means of the procedure presented in the previou...

Cyanide: All about cyanide

What is cyanide? Cyanide is a chemical compound that consist of carbon (C) and nitrogen (N). It exist in different forms, so we can say; sodium cyanide, hydrogen cyanide, potassium cyanide and others. Most of these variants (forms of cyanide) are poisonous, that in can cause death within minutes. The origin of cyanide, started from the fact that a huge number of Nazi uses the potassium cyanide suicide pills to kill themselves during the World War II. The most dangerous form of cyanide is the hydrogen cyanide, which is in the form of gas; and is deadly when inhaled. Uses of cyanide  Despite the horrible fact of cyanide as  a poison, cyanide has its own importance as it is useful.  The uses of cyanide include: I. It is used in industrial chemistry, in the production of nylon. II. It is used for pest control, bring the key ingredient in the poison used to kill animals, such as rats and other rodents. III. It is used in the mining of golds and silver, to be able to ...

Angel flight

Angel flight is a term used by group of people whose members are provided with free air transportation,  because they are in need with free medical treatment far from home. The transportation of passengers are done by volunteer pilots using their own general aviation aircraft. History of angel flight  The first two organisation to be termed "angel flight" was founded in the year 1983. The first organisation was formed in Santa Monica, California known as the "Angel flight of California (presently Angel Flight West)". The second was formed in Atlanta, Georgia and was called "Angel Flight Soars" Accidents and incidents On 15th August, 2011 a Piper PA-28 Cherokee conducting an angel flight crashed in rural Victoria, Australia. On May 24, 2013 an angel flight crashed into a pond in Ephratah, New York. On June 28, 2017 a TBIO Tobago serving an angel flight crashed into a terrain near MT Gambier heading to Adelaide. Pilots  The pilots of angel flig...