What is PHP?
What is PHP?
PHP ( Hypertext
Preprocessor) is a widely-used open source general-purpose
scripting language that is especially suited for web
development and can be embedded into HTML.
Example #1 An introductory example
<html>
<head>
<title>Example</title>
</head>
<body>
<?php
echo "Hi, I'm a PHP!";
?>
</body>
</html>
Instead of lots of commands to output HTML (as seen in C or Perl),
PHP pages contain HTML with embedded code that does
"something" (in this case, output "Hi, I'm a PHP script!").
The PHP code is enclosed in special start and end processing
instructions <?php
and ?>
that allow you to jump into and out of "PHP mode."
What can PHP do?
PHP is mainly focused on server-side scripting,
so you can do anything any other CGI program can do, such
as collect form data, generate dynamic page content, or
send and receive cookies. But PHP can do much more.
There are three main areas where PHP scripts are used.
Server-side scripting. This is the most traditional
and main target field for PHP. You need three things
to make this work. The PHP parser (CGI or server
module), a web server and a web browser. You need to
run the web server, with a connected PHP installation.
Command line scripting. You can make a PHP script
to run it without any server or browser.
You only need the PHP parser to use it this way.
Writing desktop applications. PHP is probably
not the very best language to create a desktop
application with a graphical user interface, but if
you know PHP very well, and would like to use some
advanced PHP features in your client-side applications
you can also use PHP-GTK to write such programs.
PHP can be used on all major operating systems, including
Linux, many Unix variants,
Microsoft Windows, Mac OS X, RISC OS, and probably others.
PHP has also support for most of the web servers today. This
includes Apache, IIS, and many others.
Comments