PHP Three letters that together constitutes the name of one of the world’s most popular programming languages for Web development, the PHP Hypertext Preprocessor.
While you might chuckle at the greenness of the recursive acronym, statistics indicate that PHP is not be taken lightly: the language is today in use on over twenty million Web sites and more than a third of the world’s Web servers-no small feat, especially when you consider that the language has been developed entirely by a worldwide community of volunteers and is freely available on the Internet at no cost whatsoever!
Over the last few years, PHP has become the de facto choice for the development of data-driven Web applications, notably on account of its scalability, ease of use, and widespread support for different databases and data formats.
This first chapter will gently introduce you to the world of PHP, by taking you on a whirlwind tour of PHP’s history and features, and then guiding you through writing and executing your first PHP program So flip the page, and let’s get Started.
History of PHP
PHP was originally created by a developer named Rasmus Lerdorf.
Features of PhP
If you are familiar with other server-side languages like ASP.NET or JSP you might be wondering what makes PHP so special, or so different from these competing alternatives well, here are some reasons:
- Portability(Platform Independent)
- Ease Of Use
- Open Source
- Third-Party Application Support
- Community Support
Scripts are written in PHP executives faster than those written in other scripting languages, with numerous independent benchmarks, putting the language ahead of competing alternatives like JSP,ASP.NET and PERL.The PHP 5.0 engine was completely redesigned with an optimized memory manager to improve performance and is noticeably faster than previous versions.In addition, third party accelerators are available to further improve performance and response time.
PHP is available for UNIX, MICROSOFT WINDOWS, MAC OS, and OS/2.PHP Programs are portable between platforms. As a result, a PHP application developed on, say, Windows will typically run on UNIX without any significant issues.This ability to easily undertake cross-platform development is a valuable one, especially when operating in a multi-platform corporate environment or when trying to address multiple market segments.
Ease Of Use
“Simplicity is the ultimate sophistication”, Said Leonardo da Vinci, and by that measure, PHP is an extremely sophisticated programming language. Its syntax is clear and consistent, and it comes with exhaustive documentation for the 5000+ functions included with the core distributions.This significantly reduces the learning curve for both novice and experienced programmers, and it’s one of the reasons that PHP is favored as a rapid prototyping tool for Web-based applications.
PHP is an open source project – the language is developed by a worldwide team of volunteers who make its source code freely available on the Web, and it may be used without payment of licensing fees or investments in expensive hardware or software. This reduces software development costs without affecting either flexibility or reliability. The open-source nature of the code further means that any developer, anywhere, can inspect the code tree, spit errors, and suggest possible fixes, this produces a stable, robust product wherein bugs, once discovered, are rapidly resolved – sometimes within a few hours of discovery !.
Third-Party Application Support
One of PHP’s Strengths has historically been its support for a wide range of different databases, including MySQL, PostgreSQL, Oracle, and Microsoft SQL Server. PHP 5.3 Supports more than fifteen different database engines, and it includes a common API for database access. XML support makes it easy to read and write XML documents though they were native PHP data structures, access XML node collections using Xpath, and transform XML into other formats with XSLT style sheets.
One of the nice things about a community-supported language like PHP is the access it offers to the creativity and imagination of hundreds of developers across the world.Within the PHP community, the fruits of this creativity may be found in PEAR, the PHP Extension and Application Repository and PECL, the PHP Extension Community Library, which contains hundreds of readymade widgets and extensions that developers can use to painlessly and new functionality to PHP.Using these widgets is often a more time-and cost-efficient alternative to rolling your own code.