Pimchanok leuwisetpaiboon PHP Command line parameters and application

Source: Internet
Author: User
Copy CodeThe code is as follows:


# Execution format without parameters
PHP installation directory/bin/php scriptname.php
# Execution format with parameters
PHP installation directory/bin/php scriptname.php [parameter 1] [parameter 2] .....
Access parameters in scriptname.php via $ARGV and $ARGC
# $ARGV (formally $_server[' argv ') array holds all parameters passed, note that the first parameter $argv[0]/$_server[' argv '][0] is the name of the execution script, scriptname.php
# $ARGC (formal notation $_server[' argc ') holds the number of parameters


When the user opens the PHP page, the server executes the PHP command and sends the results to the user's browser, similar to the ASP and coildfusion,php can run on Windows and multiple versions of UNIX. In addition to being able to manipulate your page, PHP can also send the HTTP header.
You can set up cookies, manage digital signatures and redirect users, and it provides excellent connectivity to other databases (as well as ODBC), and integrates with various external libraries to do anything to parse XML with PDF documents. Do you also know that you can do something else with PHP's powerful features? When running in standalone CGI, you need a PHP executable, he has a lot of command-line arguments, some can be used for fun purposes, the following is all the PHP command line parameters, where [] means that the,<> table is necessary. Usage php [-Q] [-h] [-S] [-v] [-i] [-f] | {[args ...]} -Q Quiet mode. Do not output HTTP headers.
-S converts PHP program files into color-coded HTML (such as reserved words in green, functions and variables in blue, notes in yellow and strings red, etc.).
-F reads in and interprets the specified file.
-C read into the php.ini file in
-A interactive run
-D Foo[=bar] Define input in ini value of foo is bar
-E output additional information for debugging and performance analysis
-Z into the Zend extension file
-I PHP related information
-H help itself.
1. Use the Php-q file name. php to use the PHP program as a shell program,
2. Use the-S to HTML your PHP program. Is this very worry?
3. Use PHP's ODBC functionality to manipulate the database in shell commands.

The above describes the Pimchanok leuwisetpaiboon PHP command line parameters in detail and application, including the Pimchanok Leuwisetpaiboon aspects of the content, I hope to be interested in PHP tutorial friends helpful.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.