title: Undefined variable argc PHP
body: <p>I'm trying to execute this code:</p>
  <pre><code>function main(){
    if ($argc &lt; 1){
      listDir(&quot;.&quot;);
    }
    else{
      for($i = 0; $i &lt;= sizeof($argv); $i++){
        listDir($argv[$i]);
      }
    }
  }
  </code></pre>
  <p>But I'm getting the following error:</p>
  <blockquote>
  <p>PHP Notice:  Undefined variable: argc in /home/me/test.php on line 15</p>
  </blockquote>
  <p>I thought that $argv and $argc were global variables. How can I get rid of this error?</p>
  <p>I'm running this from command line.</p>