San José State University

applet-magic.com
Thayer Watkins
Silicon Valley
& Tornado Alley
USA

The Origin and Nature of
the Scripting Language and System

PHP

PHP was developed by Rasmus Lerdorf. It was first developed in 1994 as Personal Home Page. It was released in 1995 as Personal Home Page Tools. This was a parser which interpreted files written in the simplified programming language of PHP. The programming language of PHP was developed long after other scripting language had been in use so Lerdorf was able to incorporate the lessons of programmers experience with those other languages.

The experience with the initial offering of PHP was positive enough to prompt Lerdorf to create an improved version of the parser, called PHP/FI (form interpreter). This version could interpret HTML code as well as the PHP programming code. PHP/FI also made some provision for database capabilities by supporting some elements of mSQL.

By mid-1997 there were about fifty thousand websites created using PHP. At that time the programming for PHP was recreated with a team of programmers helping Lerdorf in this effort. This revised version was called PHP 3. PHP 3 provided support for MySQL, the database query language, among a collection of other database systems.

The next version, PHP 4, increased the features of PHP but the subsequent version PHP 5 was more devoted to increasing the efficiency of the system than expanding its features. Now PHP can be included within an HTML file. An example is shown below.


<HTML>

<HEAD>
<TITLE>Welcome to PHP
</TITLE>
</HEAD>


<BODY>

<HR>

<h2>The World of PHP
</h2>

<?php

echo "Welcome to the World of PHP";

?>


<HR>


</BODY>

</HTML>

To view the results of running the above code, click here.

For an example of PHP code which does some computing consider the following. This code computes the number of days until the summer soltice, midnight of June 21st.


<HTML>

<HEAD>
<TITLE>Days Until Summer
</TITLE>
</HEAD>

<BODY>


<?php



$daystoSummer = mktime(0,0,0,6,21,2005);
$today = time();
$daystoSummer = round(((($daystoSummer - $today)/60)/60)/24,1);
echo "<p><font size=7 color=#ff00aa>Days until summer = $daystoSummer.</font>";

?>


<HR>


</BODY>

</HTML>


To view the results of running the above code, click here.

In the above code the mktime() and time() functions create time variables which are the number of seconds from a base time. The difference of these two variables is the number of seconds until summer soltice. This variable has to be divided by 60 to get the number of minutes, again by 60 to get the number of hours and by 24 to get the number of days. The result is rounded off to the nearest one tenth of a day.

The PHP packages

The programming for PHP is simple and largely standard as a programming language. The power of PHP is in the software packages which have been developed to provide web functionalities. These packages include:



HOME PAGE OF applet-magic
HOME PAGE OF Thayer Watkins