Saturday, November 10, 2007

What is PHP?

What is PHP?

PHP is an open source programming language used to build dynamic Web pages. A dynamic Web page is a page that interacts with the user so that each visitor to the page sees customized information. Dynamic Web applications are prevalent in commercial sites where the content displayed is generated from information accessed in a database or other external source. PHP scripts are embedded within a Web page along with HTML, similar to other scripting languages such as Microsoft’s Active Server Pages (ASP) or Sun Microsystems' Java Server Pages (JSP).

Like ASP and JSP, PHP is a server-side language, meaning it runs on the Web server, rather than on the Web browser or other client. PHP can be used for any application development that uses a Web browser as the user interface. Because of user preferences for and familiarity with Web browsers, the use of browser-based solutions for mission-critical enterprise applications is increasing rapidly. A law office in Indianapolis, Indiana, for example, runs its billing and client management system in PHP. Pfizer Inc., the $34 billion a year pharmaceutical giant, used PHP to build an internal time and document tracking system for monitoring field trials of new drugs. These examples illustrate the fact that the market for Web applications extends far beyond the Internet.

Why PHP?

With hardly any publicity, PHP has swept the Web. According to the authoritative Netcraft survey of what technology is actually in use on the Web, PHP can now be found on more than five million domains, and is growing at a rate of up to 15% each month. PHP is available on over 36% of Apache Web servers – the most common server on the Web. The latest version of PHP, PHP 4, was downloaded 265,000 separate times in the first two months it was available.

Why is PHP so popular? Programmers who work with PHP say it is:

  • Ideal for dynamic and interactive Web sites
  • Supports a wide variety of back-end databases (e.g., Oracle, MySQL and others)
  • Easy to use and easy to learn
  • Designed for the Web, from the ground up
  • Fast
  • Extremely reliable
  • Cross platform – Unix (e.g., Sun Solaris, Linux, Compaq Tru64, IBM AIX and more) and Windows (e.g. NT 4.0, Windows 2000); cross Web server (e.g. Apache, IIS, Zeus); and highly portable
  • Compatible with a variety of other key Web technologies, including Java, COM, XML and Macromedia Flas

The rapid growth of PHP is driven by the explosive growth of server-based applications, which are rapidly replacing traditional client-based applications; market demand for an intuitive cross-platform, easy-to-use scripting language; and increasing recognition by the business community of the ability of open-source platforms to enable the free, stable, and rapid development of high-quality software.

Enterprises are also now realizing the need for a server scripting platform to replace Java servlets. For most enterprises, time-to-launch is a primary consideration. It simply takes too long to build an application using JSP. PHP has a much lower and easier learning curve than Java, allowing for quicker development cycles – from proof-of-concept to final product design.

Ideal for Dynamic Web Sites

Back in the early days of the World Wide Web – the mid-1990s – all you needed to build a Web site was HTML and perhaps some GIF files. That was before e-commerce swept the Web, before Web sites grew to include hundreds, or in some cases thousands, of pages. Today, transaction-oriented, interactive Web sites are rapidly replacing sites built using static HTML, and Web masters are quickly realizing that trying to keep thousands of separate HTML pages updated is an impossible task.

Not surprisingly, many Web sites now use HTML or XML to display information while storing their data in a database. This allows a company to update a piece of information – say a description of an item in a catalog, or a price – only once, in the database, and have the change reflected on every page that uses that information. PHP makes it easy to do this: just insert the PHP script in the HTML, and the data will appear in the proper place on the page. PHP supports databases from companies such as Oracle, Informix, Sybase, IBM, and Microsoft, as well as open source databases such as MySQL and PostgreSQL.

PHP: Easy to Learn, Easy to Use

For software engineers, the choice of programming language is a highly personal choice. Programmers are always looking for tools that make their lives easier. The increasing shift to PHP among Web application developers is a testament to PHP’s efficiency and ease of use.

For programmers who know C, C++, or Java, PHP is extremely easy to learn. Programmers say PHP is very intuitive and even people who are not experienced programmers can quickly pick up the basics. What’s more, with the current tight labor market for programmers, some Web development companies are finding that they can hire people who are not programmers, teach them PHP, and have them producing usable code within days.

Designed for the Web

While there are many available tools for building Web sites, most were originally designed for some other purpose. Java, for instance, started out as a language geared towards client-side applets, and not server-side servlets. The Perl programming language started life as a system administration tool, and was later shoehorned into its role as a Web development language, resulting in structural problems such as memory leaks.

PHP is easy to use for Web development because it has been designed from the outset for the Web environment. That means that PHP has many built-in functions that make Web programming simpler, so that programmers can focus on the logic of programming without wasting precious development time. As a simple example, Web browsers interpret characters like the ampersand (&) as special HTML code. Programmers then have to convert the ampersands to their special HTML representation, which is "&amp". Languages such as Perl or Allaire’s Cold Fusion require complicated regular expressions, similar to global search and replacements, PHP has simple functions already built in to do this.

No comments:

Post a Comment

Yahoo! News: Technology News