This is post post in new series started by PHP Tutorials for Beginners by Gautam. This post provides general introduction to PHP and some historical facts about it! As PHP if language top-blogging platform WordPress uses, it is good to have little understanding of PHP. This will help you for sure in your blogging carrier even if programming is not your prime occupation. (Added by Editor)
PHP allows you to create very simple web pages with dynamic content to full-featured web applications that connect to back-end databases. If you use HTML to develop websites, PHP will be a next good step for you. Basic knowledge of HTML and CSS is recommended but is not necessary.
I will be starting from the very basics of PHP and then cover some important techniques that you can use in PHP. I will be also covering the basics of working with MySQL database. I recommended you to try the tutorials on your own on any free host or XAMPP (I will talk about it after a while).
Of course, I can’t cover everything but I will help you to start with it and cover the important things. You may ask any query you have in the comments section. So let’s start and best wishes to you from my side. 😉
PHP… What is it?
Well, the most common definition of PHP is that it is a HTML-embedded scripting language which runs on the server side. Also, PHP doesn’t need to be compiled like other programming languages like C or Java. Its syntax is much like C, Java and Perl. One can write dynamic pages using PHP.
PHP stands for PHP: Hypertext Preprocessor. This confuses many people because the first word of the acronym is the acronym. This type of acronym is called a recursive acronym. For more information, the curious can visit Dictionary of Computing or the Wiki entry on recursive acronyms. You can find more information on PHP here.
History of anything is usually boring but, of PHP, its very interesting!
First Version of PHP was created under the name PHP/FI (Personal Home Page/Form Interpreter) as open source by Rasmus Lerdorf in 1995.
By 1997, PHP/FI 2.0 was released; with approximately 50,000 domains reporting as having it installed (about 1% of the domains on the Internet).
Here is an example of PHP/FI Code:
(Note: Following codes no longer works today. Also PHP syntax is different today!)
<!--ifsubstr $exec_result Mozilla-->
Hey, you are using Netscape!
<!--sql database select * from table where user='$username'-->
<!--ifless $numentries 1-->
Sorry, that record does not exist
You have <!--$index:0--> credits left in your account.
PHP 3.0 was the first version that closely resembles PHP as we know it today. It was created by Andi Gutmans and Zeev Suraski in 1997 as a complete rewrite, after they found PHP/FI 2.0 severely underpowered for developing an eCommerce application they were working on for a university project.
The whole new language was released under a new name. It was named plain ‘PHP’, with the meaning being a recursive acronym – PHP: Hypertext Preprocessor. By the end of 1998, PHP grew to an install base of tens of thousands of users (estimated) and hundreds of thousands of websites reporting it installed. At its peak, PHP 3.0 was installed on approximately 10% of the Web servers on the Internet. By the winter of 1998, shortly after PHP 3.0 was officially released, Andi Gutmans and Zeev Suraski had begun working on a rewrite of PHP’s core.
The new engine, dubbed ‘Zend Engine’ (comprised of their first names, Zeev and Andi), was first introduced in mid 1999. PHP 4.0 was based on this engine and was officially released in May 2000.
PHP 5 was released in July 2004 after long development and several pre-releases. It is mainly driven by its core, the Zend Engine 2.0 with a new object model and dozens of other new features.
Here is an example of PHP 5.0 Code:
echo "Hello World!";
You may read the full history of PHP here.
My next post will contain what programs you need (recommended ones) with their configuration to use PHP.