Sophie

Sophie

distrib > Mageia > 7 > aarch64 > by-pkgid > 2b917e0437961edec048f1d15e2d7449 > files > 12183

php-manual-en-7.2.11-1.mga7.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The number of arguments passed to script</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="reserved.variables.httpresponseheader.html">$http_response_header</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="reserved.variables.argv.html">$argv</a></div>
 <div class="up"><a href="reserved.variables.html">Predefined Variables</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="reserved.variables.argc" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">$argc</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">$argc</span> &mdash; <span class="dc-title">The number of arguments passed to script</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-reserved.variables.argc-description">
  <h3 class="title">Description</h3>
  <p class="para">
   Contains the number of arguments passed to the current script when running
   from the <a href="features.commandline.html" class="link">command line</a>.
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <span class="simpara">
    The script&#039;s filename is always passed as an argument to the script, therefore
    the minimum value of <var class="varname"><var class="varname">$argc</var></var> is <em>1</em>.
   </span>
  </p></blockquote>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <span class="simpara">
    This variable is not available when <a href="ini.core.html#ini.register-argc-argv" class="link">register_argc_argv</a>
    is disabled.
   </span>
  </p></blockquote>
 </div>

 
 <div class="refsect1 examples" id="refsect1-reserved.variables.argc-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-303">
    <p><strong>Example #1 <var class="varname"><var class="varname">$argc</var></var> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$argc</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>
     When executing the example with: php script.php arg1 arg2 arg3
    </p></div>
    <div class="example-contents"><p>The above example will output
something similar to:</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
int(4)
</pre></div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-reserved.variables.argc-notes">
  <h3 class="title">Notes</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    This is also available as <var class="varname"><var class="varname"><a href="reserved.variables.server.html" class="classname">$_SERVER['argc']</a></var></var>. 
   </p>
  </p></blockquote>
 </div>


<div class="refsect1 seealso" id="refsect1-reserved.variables.argc-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.getopt.html" class="function" rel="rdfs-seeAlso">getopt()</a> - Gets options from the command line argument list</span></li>
    <li class="member"><a href="reserved.variables.argv.html" class="link"><var class="varname"><var class="varname"><a href="reserved.variables.argv.html" class="classname">$argv</a></var></var></a></li>
   </ul>
  </p>
 </div>

 
</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="reserved.variables.httpresponseheader.html">$http_response_header</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="reserved.variables.argv.html">$argv</a></div>
 <div class="up"><a href="reserved.variables.html">Predefined Variables</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>