PHP
Hypertext Preprocessor

Main of web development is to build different websites. Purpose of PHP

Things You Should Know about PHP

PHP stands for PHP: Hypertext Preprocessor. As we said before it is a server-side scripting language. PHP is free and is an open source software product. The PHP scripts are executed on the server. PHP supports many databases (MySQL, Sybase, Oracle and many others.) PHP runs on different platforms (Unix, Linux, Windows.) PHP is compatible with almost all web-servers used today (Apache, IIS, etc.) A PHP file can contain plain text, HTML tags and scripts The PHP files can have one of the following extensions: php, php3 or phtml


What is PHP ?

The PHP programming language is a server-side HTML embedded scripting language. Let‘s depict the sentence. The PHP language runs on the server-side. This means that the execution (read starting) of the scripts are done on the server where the web-site is hosted. HTML embedded means that you can use PHP statements (read a piece of PHP code) from within an HTML code. PHP files are returned to the browser as plain HTML. The last piece of the sentence – scripting language – is a little harder to explain, but we will give it a go. A scripting language is a form of programming language that is usually interpreted rather than compiled. In programming languages such C or C++ you compile the program (permanently) into an executable file, before you can execute the program.



A program that is written in a scripting language, is interpreted one command at a time by a command interpreter (Command interpreter is in most cases an executable written in another language (for instance C/C++) than the scripting language.) Some other examples of scripting languages are Perl, Phyton, Java and Ruby.
1 What do you need?
. Before you can follow the coming PHP tutorials you need to have the following:
. PHP and MySQL should be installed on the web server.
. Access to a web server (like Apache)
. The easiest way is to find a cheap web hosting plan that support PHP and MySQL (most of the web-hosting providers do.) For a couple of bucks a month you can get a virtual host. The advantage is that everything is already installed and that you can share your program (that you are going to write) with the rest of the world. If you don’t want to spend money, you can also install everything on your local machine. The easiest way is to install WAMP if you have a Windows machine and LAMP if you have a Linux machine. (WAMP = Windows Apache MySQL PHP and LAMP = Linux Apache MySQL PHP.) These packages install everything you need. Read the install manual of these packages for instructions. After installation you should have access to http://localhost in your browser.
. To keep things small we will not place every example between some piece of PHP code . In most cases you need to add it yourself if you cut/paste some piece of code.
. That is all for this PHP language introduction tutorial. We hope that you will learn something from the coming PHP tutorials and as always we hope that you will let us know if something is wrong by leaving us a comment
2 PHP 3 and 4
. Zeev Suraski and Andi Gutmans rewrote the parser in 1997 and formed the base of PHP 3, changing the language's name to the recursive acronym PHP: Hypertext Preprocessor.Afterwards, public testing of PHP 3 began, and the official launch came in June 1998. Suraski and Gutmans then started a new rewrite of PHP's core, producing the Zend Engine in 1999. They also founded Zend Technologies in Ramat Gan, Israel.
. On May 22, 2000, PHP 4, powered by the Zend Engine 1.0, was released. As of August 2008 this branch reached version 4.4.9. PHP 4 is no longer under development nor will any security updates be released.
3 PHP 5
. On July 13, 2004, PHP 5 was released, powered by the new Zend Engine II. PHP 5 included new features such as improved support for object-oriented programming, the PHP Data Objects (PDO) extension (which defines a lightweight and consistent interface for accessing databases), and numerous performance enhancements. In 2008 PHP 5 became the only stable version under development. Late static binding had been missing from PHP and was added in version 5.3.
. Many high-profile open-source projects ceased to support PHP 4 in new code as of February 5, 2008, because of the initiative, provided by a consortium of PHP developers promoting the transition from PHP 4 to PHP 5.
. Over time, PHP interpreters became available on most existing 32-bit and 64-bit operating systems, either by building them from the PHP source code, or by using pre-built binaries. For the PHP versions 5.3 and 5.4, the only available Microsoft Windows binary distributions were 32-bit x86 builds, requiring Windows 32-bit compatibility mode while using Internet Information Services (IIS) on a 64-bit Windows platform. PHP version 5.5 made the 64-bit x86-64 builds available for Microsoft Windows.
4 PHP 6 and Unicode
. PHP has received criticism due to lacking native Unicode support at the core language level, instead only supporting byte strings. In 2005, a project headed by Andrei Zmievski was initiated to bring native Unicode support throughout PHP, by embedding the International Components for Unicode (ICU) library, and representing text strings as UTF-16 internally. Since this would cause major changes both to the internals of the language and to user code, it was planned to release this as version 6.0 of the language, along with other major features then in development.
. However, a shortage of developers who understood the necessary changes, and performance problems arising from conversion to and from UTF-16, which is rarely used in a web context, led to delays in the project. As a result, a PHP 5.3 release was created in 2009, with many non-Unicode features back-ported from PHP 6, notably namespaces. In March 2010, the project in its current form was officially abandoned, and a PHP 5.4 release was prepared containing most remaining non-Unicode features from PHP 6, such as traits and closure re-binding. Initial hopes were that a new plan would be formed for Unicode integration, but as of 2014 none have been adopted.
5 PHP 7
. During 2014 and 2015, a new major PHP version was developed, which was numbered PHP 7. The numbering of this version involved some debate. While the PHP 6 Unicode experiment had never been released, several articles and book titles referenced the PHP 6 name, which might have caused confusion if a new release were to reuse the name. After a vote, the name PHP 7 was chosen.
. The foundation of PHP 7 is a PHP branch that was originally dubbed PHP next generation (phpng). It was authored by Dmitry Stogov, Xinchen Hui and Nikita Popov, and aimed to optimize PHP performance by refactoring the Zend Engine to use more compact data structures with improved cache locality while retaining near-complete language compatibility. As of 14 July 2014, WordPress-based benchmarks, which served as the main benchmark suite for the phpng project, showed an almost 100% increase in performance. Changes from phpng are also expected to make it easier to improve performance in the future, as more compact data structures and other changes are seen as better suited for a successful migration to a just-in-time (JIT) compiler. Because of the significant changes, the reworked Zend Engine is called Zend Engine 3, succeeding Zend Engine 2 used in PHP 5.
. Because of major internal changes in phpng, it must receive a new major version number of PHP, rather than a minor PHP 5 release, according to PHP's release process. Major versions of PHP are allowed to break backward-compatibility of code and therefore PHP 7 presented an opportunity for other improvements beyond phpng that require backward-compatibility breaks, including wider use of exceptions, reworking variable syntax to be more consistent and complete, and the deprecation or removal of various legacy features.
. PHP 7 also introduced new language features, including return type declarations for functions, which complement the existing parameter type declarations, and support for the scalar types (integer, float, string, and boolean) in parameter and return type declarations.