PHP: Hypertext Preprocessor (formerly called Personal Home Page) is a scripting language especially suited to web development. PHP is widely used to program dynamic web sites. PHP can be used to build a CMS.
Not only running through a web server, PHP can also complete programming tasks in the form of a command line interface (CLI).
History of PHP
Initially PHP was short for Personal Home Page (Personal site). PHP was first created by Rasmus Lerdorf in 1995. At that time PHP was still called Form Interpreted (FI), which is a set of scripts used to process form data from the web.
Then Rasmus released the source code to the public and named it PHP / FI. With the release of this source code being open source, many programmers are interested in developing PHP.
In November 1997, PHP / FI 2.0 was released. In this release, the PHP interpreter has been implemented in the C program. This release includes extension modules that significantly improve PHP / FI capabilities.
In 1997, a company called Zend rewrote the PHP interpreter to be cleaner, better, and faster. Then in June 1998, the company released a new interpreter for PHP and formalized the release as PHP 3.0 and the PHP acronym was changed to the recurring acronym PHP: Hypertext Preprocessor.
In mid-1999, Zend released a new PHP interpreter and the release was known as PHP 4.0. PHP 4.0 is the most widely used version of PHP in the early 21st century. This version is widely used due to its ability to build complex web applications but still has high speed and stability.
In June 2004, Zend released PHP 5.0. In this version, the core of the PHP interpreter underwent major changes. This version also incorporates an object-oriented programming model into PHP to respond to the development of programming languages towards the object-oriented paradigm. A built-in web server was added in version 5.4 to make it easier for developers to run PHP code without installing a software server.
The latest and most stable version of the PHP programming language is version 8.0.
PHP Basic Syntax
PHP only executes code written in delimiters as defined by the basic PHP syntax. Anything outside the delimiter is not processed by PHP (although this PHP text still controls the structure described in PHP code. The most common constraints are
<? Php for opening and
Variables are preceded by the dollar symbol $. The PHP 5 version of php introduced a type of gesture that allows functions to force them to be object parameters of a particular class, array, or function. However, the hint type cannot be used with scalar types such as numbers or strings. Example variables can be written as $name_variabel.
Function writing, class naming, variable names are case sensitive (Capital) and lowercase letters. The two double quotes "" of the string provide the ability to interpolate variable values into PHP strings. PHP translates lines as spaces, and statements must end with a semicolon;.
PHP has 3 types of syntax as comments to code, namely the block sign / * * /, 2 line comments // And hash mark # is used for single line comments. Comments are intended to leave notes in the PHP code and will not be translated into the program.
Hundreds of functions provided by PHP as well as thousands of others are available through various additional extensions. these functions are documented in the PHP documentation. However, in various stages of development, now have various naming conventions.
The advantages of PHP from other Web Programming Languages
Some of the advantages of PHP from the web programming language include:
- The PHP programming language is a scripting language that the users does not need to compile the code.
- PHP-enabled web servers can be found everywhere from Apache to IIS, Lighttpd to Xitami with relatively easy configuration.
- On the development side, it is easier, because of the many mailing lists and developers who are ready to help in development.
- In terms of understanding, PHP is the easiest scripting language because it has many references.
- PHP is an open source language that can be used on various machines (Linux, Unix, Macintosh, Windows) and can be run at runtime through the console and can also run system commands.
PHP popularity and usage statistics
PHP is used for Web content management systems including MediaWiki, WordPress, Joomla, Drupal, Moodle, eZ Publish, eZ Platform, and SilverStripe.
Websites using PHP include Facebook, Digg, Dailymotion, Tumblr.
As of January 2013, PHP was used in more than 240 million websites (39% of those sampled) and was installed on 2.1 million web servers.
As of August 2019, PHP was used as the server-side programming language on 78.8% of websites, down from 83.5% previously, where the language could be determined.
As of April 2020, PHP 7 is the most used version of the language with 50.6% of sites using PHP and 39.6% of all websites on the web.