What is PHP?

  • PHP stands for Hypertext Preprocessor.
  • It is an interpreted language, i.e. there is no need for compilation.
  • It is a server-side scripting language.
  • PHP is faster than other scripting languages e.g. asp and jsp( Java).

The Benefits of PHP, MySQL, JavaScript, CSS, and HTML5

At the start of this chapter, We told one thing here you found Best PHP training and PHP tutorial for beginners. I introduced the world of Web 1.0, but it wasn’t long before
the rush was on to create Web 1.1, with the development of such browser enhancements
as Java, JavaScript, JScript (Microsoft’s slight variant of JavaScript), and ActiveX. On the
server side, progress was being made on the Common Gateway Interface (CGI) using
scripting languages such as Perl (an alternative to the PHP language) and server-side
scripting—inserting the contents of one file (or the output of a system call) into another
one dynamically.

Once the dust had settled, three main technologies stood head and shoulders above the
others. Although Perl was still a popular scripting language with a strong following,
PHP’s simplicity and built-in links to the MySQL database program had earned it more
than double the number of users. And JavaScript, which had become an essential part
of the equation for dynamically manipulating CSS (Cascading Style Sheets) and HTML,
now took on the even more muscular task of handling the client side of the Ajax process.

Under Ajax, web pages perform data handling and send requests to web servers in the
background—without the web user being aware that this is going on.
No doubt the symbiotic nature of PHP and MySQL helped propel them both forward,
but what attracted developers to them in the first place? The simple answer has to be
the ease with which you can use them to quickly create dynamic elements on websites.

Mysql using with  PHP

MySQL is a fast and powerful, yet easy-to-use, a database system that offers just about anything a website would need in order to find and serve up data to browsers. When
PHP allies with MySQL to store and retrieve this data, you have the fundamental parts
required for the development of social networking sites and the beginnings of Web 2.0.

And when you bring JavaScript and CSS into the mix too, you have a recipe for building
highly dynamic and interactive websites


Using PHP

With PHP, it’s a simple matter to embed dynamic activity in web pages. When you give
pages the .php extension, they have instant access to the scripting language. Therefore, From a
developer’s point of view, all you have to do is write code such as the following:

echo " Today is " . date("l") . ". ";

Here’s the latest news.
The opening tells<?php the web server to allow the PHP program to interpret all the
following code up to the ?> tag. Outside of this construct, everything is sent to the client
as direct HTML. So the text Here’s the latest news. is simply output to the browser;
within the PHP tags, the built-in date function displays the current day of the week
according to the server’s system time.

The final output of the two parts looks like this:

Today is Wednesday. Here's the latest news.

PHP is a flexible language, and some people prefer to place the PHP construct directly
next to PHP code, like this:

Today is <?php echo date("l"); ?>.

Here’s the latest news.
There are also other ways of formatting and outputting information, which I’ll explain
in the chapters on PHP. The point is that with PHP, web developers have a scripting
language that, although not as fast as compiling your code in C or a similar language,
is incredibly speedy and also integrates seamlessly with HTML markup.


If you intend to enter the PHP examples in this book to work along
with me, you must remember to add <?php in front and ?> after them
to ensure that the PHP interpreter processes them. To facilitate this,
you may wish to prepare a file called example.php with those tags in


<< Prev Next >>