PHP

PHP is a server side scripting language. It is used to create Static websites or Dynamic websites or Web pages. PHP understands for Hypertext Pre-processor, that under stood by Personal Home Pages.

PHP scripts can only be interpreted on a server that can PHP installed.

The client computers accessing the PHP scripts need a web browser only.

A PHP file contains ends with the extension .php or PHP tag.

PHP used for Hypertext Preprocessor.

  • PHP is an interpreted language, i.e., there is no require for compilation.
  • PHP is a server-side scripting language.
  • PHP is faster than other scripting languages, for example, ASP and JSP.

History And Evolution Of PHP

PHP was stuructured for web development, initially to fill the gap between Server Side Including (SSI) and Perl. The language’s started were laid in 1994 through the work of  Rasmus Lerdorf  who scripted a versions of Common Gateway Interface (CGI) binaries in C to access his homepage. Generally, he improved these to include the capable to interact with databases and web forms and named it PHP/FI meaning “Personal Home Page/Forms Interpreter”. The start version of  PHP/FI was released in 1995 with syntax, variables and form handling resembling Perl language. The second version PHP/FI 2 was released in 1997.

The team enlarged in 1997 to include Zeev Suraski and Andi Gutmans who re-scripted the parser to form the base of PHP3 and renamed it PHP: Hypertext PreprocessorThe redoing work continued next and in 1999, it leads to the development of Zend Engine which can discussed as an interpreter for PHP language.

Over the years, the updating of the language has continued and the latest version PHP 5.6.4 was released in December 2014

What does PHP stand for?

  • PHP means – Personal Home Page, but it now stands for the recursive backronym PHP: Hypertext Preprocessor.
  • PHP code may be embedded into HTML code, or it can be used in combination with various web template systems, web content management system and web frameworks.

Why use PHP?

You have generally head of a lot of programming languages out there; you may be confusing why we should prefer use PHP as our harmful for the web programming. Below are some of the compelling reasons.

  • PHP is open source and free.
  • Short learning curve compared to other languages such as JSP, ASP etc.
  • Large community document
  • Most web hosting servers support PHP by default unlike other languages such as ASP that need IIS. This makes PHP a cost effective choice.
  • PHP is regular updated to keep abreast with the latest technology trends.
  • Other benefit that you get with PHP is that it’s a server side scripting language; this means you only need to install it on the server and client computers requesting for resources from the server do not require  to have PHP installed; only a web browser would be need.
  • PHP has in built support for working hand in hand with MySQL; this doesn’t mean you can’t use PHP with other database management systems. You can still use PHP with
    • Postgres
    • Oracle
    • MS SQL Server
    • ODBC etc.
  • PHP is cross platform; this means you can deploy your application on a number of different operating systems such as windows, Linux, Mac OS etc.

 

PHP Syntax

A PHP file contain multiple various tags such as HTML and client side scripts like a JavaScript.

  • HTML is an added advantage when learning PHP Language. You can also learn PHP without knowing HTML but it’s suggested you at least know the starting of HTML.
  • Database management systems DBMS for database powered applications.
  • For more advanced topics such as interactive applications and web services, you will need JavaScript and XML.
PHP File extensions

File extension and Tags In order for the server to identify our PHP files and scripts, we must save the file with the “.php” extension. Older PHP file extensions include

  • .phtml
  • .php3
  • .php4
  • .php5
  • .phps

PHP was designed to work with HTML, and as such, it can be embedded into the HTML code.

<HTML><PHP CODE></HTML>

 

You can create PHP files without need html tags and that is called best PHP file .

The server creates the PHP code and outputs the process as HTML code to the web browsers.

In order for the server to distinguish the PHP code from the HTML code, we sure always ending the PHP code in PHP tags.

A PHP tag starts with the less than symbol proceed by the question mark and then the words “php”.

The PHP tags basically  are not case-sensitive, but it is strongly suggested that we use lower case letter.

<?php … ?>

We will be referring to the PHP lines of code as statements. PHP statements ending with  semi colon (;). If you only have one statement, you can omit the semi colon. If you have increase than one line, then you must end each line with a semi colon. For the sake of consistency, it is recommended that you always end your statement(s) with a semi colon.  PHP scripts are executed on the server. The output is returned in form of HTML.

Applications Of PHP

PHP is widely used in web development nowadays. PHP can develop dynamic websites easily.  PHP programming language is basically used for creating web-based software applications.  In 2013,PHP found application in over 244 million websites in world.

  • Web pages and web-based applications
  • Web Content Management Systems (CMS)
  • eCommerce applications
  • Image Processing and graphic design
  • Data representation
Summary
  • PHP stands for Hypertext pre-processor
  • PHP is a server side scripting language. This means that it is executed on the server. The client applications do not require to have PHP installed.
  • PHP files are store with the “.php” file extension, and the PHP development code is ending closed tags.
  • PHP is an open source and cross platform