PHP in action
Example 1: Date
Today is Wednesday January 07, 2009 but last Modified 12/29/08 05:46
The PHP script simply displays the date and time this file was last modifiied.
Example 2: Calculation
Fred is 95 years old.
And the second example calculates the age (roughly in years) of someone born in 1914.
Example 3: Simple function call
And the old favourite, showing details on your browser:
CCBot/1.0 (+http://www.commoncrawl.org/bot.html)
Example 4: Database?
Do we have a MySQL client version? (and do we have permissions on MySQL?):
Version:5.0.22
PHP is a powerful server-side scripting language for creating dynamic and interactive websites.
PHP is the widely-used, free, and efficient alternative to competitors such as Microsoft's ASP. PHP is perfectly suited for Web development and can be embedded directly into the HTML code.
The PHP syntax is very similar to Perl (a scripting language) and C (the main programming language used on Unix/Linux platforms). PHP is often used together with Apache (web server) on various operating systems. It also supports ISAPI and can be used with Microsoft's IIS on Windows.