PHP can do anything. PHP is mainly used for server-side scripts, so you can use PHP to complete any work that other CGI programs can do, such as collecting form data, generating dynamic web pages, or sending/receiving Cookies. But PHP’s capabilities go far beyond that.
PHP scripts are mainly used in the following three areas:
Service end script. This is the most traditional and main target area of PHP. (Recommended learning: PHP video tutorial)
To carry out this work, you need the following three points: PHP parser (CGI or server module), web server and web browser. You need to install and configure PHP when running the web server. Then, you can use a web browser to access the output of the PHP program, that is, browse the PHP page on the server.
If you are just experimenting with PHP programming, all of this can be run on your home computer. Please consult the Installation chapter for more information.
Command line script. You can write a PHP script and don't need any server or browser to run it.
In this way, only the PHP parser is needed to execute. This usage is ideal for daily running scripts that rely on cron (Unix or Linux environments) or Task Scheduler (Windows environments). These scripts can also be used to process simple text. See PHP's command line mode for more information.
Write desktop applications. For desktop applications with graphical interfaces, PHP may not be the best language, but if the user is very proficient in PHP and wants to use some advanced features of PHP in client applications, they can use PHP- GTK to write these programs.
Using this method, you can also write cross-platform applications. PHP-GTK is an extension of PHP that is not included in the commonly distributed PHP packages. If you are interested in PHP-GTK, please visit its » website for more information.
Using PHP is not limited to outputting HTML. PHP can also be used to dynamically output images, PDF files and even Flash animations (using libswf and Ming).
It can also output text very easily, such as XHTML and any other form of XML file. PHP can automatically generate these files, open up a cache of dynamic content on the server, and print them out directly, or store them in the file system.
The above is the detailed content of What can php do. For more information, please follow other related articles on the PHP Chinese website!