Re: varibles defination

From: Date: Sun, 07 Aug 2005 02:39:55 +0000
Subject: Re: varibles defination
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-220160@lists.php.net to get a copy of this message
edwardspl@ita.org.mo wrote: >>>How can we define and display the varibles by using for loop >>>function ? >> >><?php >>for ($x=0;$x<10;$x++){ >> $func[$x]=$x; >>} >>print_r($func); >>?> > > > If I want to define a set of varibles ( two dimension array, eg : $func[0,0] ) $func[0,0] is not valid syntax. you mean $func[0][0] > and via the varibles of form tag ( format, eg : $_GET["varname"] or > $_POST["varname"] )... > How about the example ? watch what happen to $_POST when you stick these fields in your form and submit it: <input type="text" value="a" name="test[a]" /> <input type="text" value="b" name="test[b]" /> <input type="text" value="c" name="test[c]" /> <input type="text" value="d1" name="test[d][]" /> <input type="text" value="d2" name="test[d][]" /> > > Edward. >

« previous php.general (#220160) next »