note 36296 added to reserved.variables

From: Date: Fri, 03 Oct 2003 21:42:55 +0000
Subject: note 36296 added to reserved.variables
Groups: php.notes 
Request: Send a blank email to php-notes+get-57782@lists.php.net to get a copy of this message
I am teaching myself php and am once again disapointed in a language and its documentation. <sigh> Just trying to get the basics down like fetching arguments from the command line and its utterly inscrutable!!! $_GET seems to be the correct predefined global variable for fetching the command line. It is defined as a global variable, and yet in actuality it is a function?!? getvars.php?abc This <?php echo $_GET ?> yields "Array"... This <?php echo $_GET[1] yields nothing Yet.... getvars.php?abc=1 This <?php echo $_GET['abc'] ?> yields "1" Clearly this is not a variable, it is a function. When something takes a parameter and returns a value its a function, variables do NOT do this in ANY language. I have also not yet deternined how to call a php script [program] with multiple vars on the command line, or even know how many there are! Can someone please help me out here? Is there some like argc or args that is equivilent to C or something like ParamCount() in Pascal ? I mean is C it would be : void main(*char args, int argc) { int i ; for(i=1,i=argc,i++) { printf('Argument %i is %s ',i,args[i]) } } Or in pascal it would be procedure Main ; var x : integer begin for x := 1 to ParamCount do writeln(ParamStr(x)); end; Thanks in advance. ---- Manual Page -- http://www.php.net/manual/en/reserved.variables.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+36296 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+36296&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+36296&report=yes Search Tool -- http://master.php.net/manage/user-notes.php

« previous php.notes (#57782) next »