mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
Rewrite of $argv blurb, which not only contained a typo, but was rather confusing in its present form.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@305839 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
fb877d96cb
commit
bbf6fbd070
1 changed files with 8 additions and 3 deletions
|
@ -1075,9 +1075,14 @@ $ some_application | some_filter | php | sort -u > final_output.txt
|
|||
can be passed to your script is not limited by PHP (the shell has a certain
|
||||
size limit in the number of characters which can be passed; usually you won't
|
||||
hit this limit). The arguments passed to your script are available in the
|
||||
global array <varname>$argv</varname>. The zero index always contains the
|
||||
script name (which is <literal>-</literal> in case the PHP codeis coming from
|
||||
either standard input or from the command line switch <option>-r</option>).
|
||||
global array <varname>$argv</varname>. The first index (zero) always contains the
|
||||
name of the script as called from the command line. Note that, if the code is
|
||||
executed in-line using the command line switch <option>-r</option>, the value of
|
||||
<varname>$argv[0]</varname> will be simply a dash (<literal>-</literal>). The
|
||||
same is true if the code is executed via a pipe from <literal>STDIN</literal>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The second registered global variable is <varname>$argc</varname> which
|
||||
contains the number of elements in the <varname>$argv</varname> array
|
||||
(<emphasis role="strong">not</emphasis> the number of arguments passed to the
|
||||
|
|
Loading…
Reference in a new issue