What is PHP?
PHP stands for "Hypertext
Preprocessor".
It is a widely-used for Web development. It can be embedded
into HTML and make the static HTML dynamic web page. See the following
example:
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo '<p>Hello World</p>'; ?>
</body>
</html>
PHP is server-side script. The client
would receive the results of running that script, with no way of
determining what the underlying code may be.
The best things in using PHP are that it is extremely simple for
a newcomer, but offers many advanced features for a professional
programmer.
What can PHP Do?
Anything. 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 webserver and a web
browser. You need to run the webserver, 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. This type of usage is ideal for scripts regularly
executed using cron (on *nix or Linux) or Task Scheduler (on
Windows).
-
Writing desktop applications. PHP is probably not the very best
language to create desktop application with a graphical user
interface, but it can!
- cross-platform applications if you know PHP very well.
PHP can be used on all major operating systems, including Linux,
many Unix variants (including HP-UX, Solaris and OpenBSD), Microsoft
Windows, Mac OS X, RISC OS, and probably others.
PHP has also support
for most of the web servers today. This includes Apache, Microsoft
Internet Information Server(IIS), Personal
Web Server(PWS), Netscape and
iPlanet servers, Oreilly Website Pro
server, Caudium, Xitami, OmniHTTPd,
and many others.
For the majority of the servers PHP has a module,
for the others supporting the CGI standard, PHP can work as a
CGI processor.
So with PHP, you have the freedom of choosing an operating system
and a web server. Furthermore, you also have the choice of using
procedural programming or object oriented programming, or a mixture
of them.
PHP 5 fixes the
OOP related weaknesses of PHP 4, and introduces a complete object
model.
With PHP you are not limited to output HTML. PHP's abilities includes
outputting images, PDF files and even Flash movies (using libswf
and Ming) generated on the fly.
|