Home

VirtueMart Product Categories

VirtueMart Product Scroller


Warning: Invalid argument supplied for foreach() in /home/clickthe/public_html/modules/mod_productscroller/mod_productscroller.php on line 220

VirtueMart Module


List All Products


Advanced Search

VirtueMart All-In-One

VirtueMart Shopping Cart

VirtueMart
Your Cart is currently empty.

VirtueMart Currency Selector


VirtueMart Featured Products

VirtueMart Latest Products

VirtueMart Manufacturers



Warning: Invalid argument supplied for foreach() in /home/clickthe/public_html/modules/mod_virtuemart_manufacturers/mod_virtuemart_manufacturers.php on line 67


VirtueMart Random Products

VirtueMart Search

PHP 01 PDF Print E-mail
Written by Administrator   
Thursday, 10 September 2009 21:17

What Is PHP?

PHP is a language that has outgrown its name. It was originally conceived as a set of macros to help coders maintain personal home pages, and its name grew from its purpose. Since then, PHP's capabilities have been extended, taking it beyond a set of utilities to a full-featured programming language, capable of managing huge database-driven online environments.

As PHP's capabilities have grown, so too has its popularity. According to NetCraft (http://www.netcraft.com), PHP was running on more than 1 million hosts in November 1999. As of September 2001, that figure had already risen to over 6 million hosts, and by October 2003 PHP was reportedly installed on almost 14 million hosts. According to SecuritySpace.com, PHP is the most popular Apache module available, beating mod_ssl, Perl, and FrontPage.

PHP is officially known as PHP: Hypertext Preprocessor. It is a server-side scripting language often written in an HTML context. Unlike an ordinary HTML page, a PHP script is not sent directly to a client by the server; instead, it is parsed by the PHP engine. HTML elements in the script are left alone, but PHP code is interpreted and executed. PHP code in a script can query databases, create images, read and write files, talk to remote servers—the possibilities are endless. The output from PHP code is combined with the HTML in the script and the result sent to the user.

PHP is also installed as a command-line application, making it an excellent tool for scripting on a server. Many system administrators now use PHP for the sort of automation that has been traditionally handled by Perl or shell scripting.

What Need Does PHP Fulfill?

There have been scripting solutions for as long as there has been a World Wide Web. As the need to create sites with dynamic content has grown in recent years, so has the pressure to create robust environments quickly and efficiently. Although C can be a great solution for creating fast server tools, it is also hard to work with and can easily produce security holes if not carefully deployed. Perl, a language originally developed for text processing naturally met the demand for dynamic Web environments. Much easier to deploy safely than C, its slower performance has always been more than balanced by the comparatively fast development cycle it offers. Even more useful has been the increasing availability of a large number of stable code libraries for Perl.

So where does PHP fit in? PHP was written especially for the Web. Many of the issues and problems faced by Web programmers are addressed within the language itself. Whereas a Perl programmer must use an external library or write code to acquire data submitted by the user of a Web page, PHP makes this data automatically available. Whereas a Perl programmer must install modules to enable her to write database-driven environments, PHP bundles a powerful SQL database library and provides built-in support for a whole range of third-party databases. In short, because PHP has been created for Web programmers, it has a set of functions for almost any typical problem you might encounter, from managing user sessions to handling XML documents.

So, do we have to pay for this ease of use with even slower performance? Not at all. PHP is designed to run as a module with many server applications, which means that there are none of the start-up overheads associated with CGI scripts. The fact that many typical tasks are handled by PHP means that developers are freed from reliance on utility libraries that can slow things down.

It is not the case that PHP does not provide libraries, though. Perl has the Comprehensive Perl Archive Network (CPAN), and PHP has the PHP Extension and Application Repository (PEAR)—its own repository of powerful packages that extend PHP's power.

What's New in PHP 5

PHP 5 introduces numerous new features that will make the programmer's life more interesting. Let's take a quick look at some of them. If they don't make sense to you now, don't worry, we cover all these features in detail in this book:

  • PHP has new integrated for support for XML. The various functions and classes provided to handle XML in different ways all now use the same underlying library (libxml2). This should make XML features more stable and interoperable.

  • The SQLite SQL library is now bundled with PHP, together with all the functions you need to work with it.

  • PHP now supports private and protected methods and properties in classes.

  • PHP supports class constants.

  • Objects passed to functions and methods are now passed by reference. That is, a reference to an object is passed around your script rather than copies of objects. This significantly reduces the likelihood of bugs in object-oriented code.

  • PHP supports static methods and properties, making more advanced object-oriented designs possible.

  • Methods can now be declared to require particular object types.

  • The comparison operator (===) now checks that two references point to the same object. Previously, it was hard to test objects in this way.

  • PHP now supports abstract classes and interfaces.

Many of these improvements are due to some fundamental changes under the hood.

 
Banner
Copyright © 2010 Site - Click Then Buy. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.