Sophie

Sophie

distrib > Mageia > 4 > i586 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 11031

php-manual-en-5.5.7-1.mga4.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)</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="variable.argc.basic">
    <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><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>