I am trying to execute this code:
function main(){ if ($argc < 1){ listDir("."); } else{ for($i = 0; $i <= sizeof($argv); $i++){ listDir($argv[$i]); } } }
But I get the following error:
PHP Notice: Undefined variable: argc in /home/me/test.php on line 15
I thought $ argv and $ argc are global variables! How can I get rid of this error? Thanks.
Pol0nium
source share