Tuesday, January 4, 2011

What is PHP?

Hypertext Preprocessor is a widely used scripting language for general purpose that was originally designed for web development to generate dynamic web pages.

What distinguishes PHP from something like client-side JavaScript is that the code runs on the server, generating HTML that is sent to the client. The client will receive the results of running on the server, but do not know what the underlying code was. You can even configure your web server to process all HTML files with PHP, and then there's really no way that users can say what you have up his sleeve.

Best to use PHP is that it is extremely simple for a newcomer, but offers many advanced features for professional programmers. Do not be afraid reading the long list of features of PHP. You can jump quickly and start writing simple scripts in a few hours.

What can you do with PHP?

Anything. PHP is mainly focused on scripting server side, 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. However, PHP can do much more.

There are three main areas where PHP scripts are used.

* On the server side scripting. This is the most traditional and main target of work. 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 PHP installed. You can access the PHP program output with a web browser, viewing the PHP page through the server. All of these can run on your machine at home if you are just experimenting with PHP programming. See the setup instructions for more information.

* Command line scripting. You can make a PHP script and 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 Unix or Linux) or Task Scheduler (on Windows). These scripts can also be used for simple tasks of word processing. See the section on the line usage of PHP for more information.

* Writing desktop applications. PHP is probably not the 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 features in the client-side applications can also use PHP-GTK to write such programs . You also have the ability to write cross-platform applications this way. PHP-GTK is an extension of PHP, not available in the main distribution. If you are interested in PHP-GTK, visit "their own website. 

No comments:

Post a Comment