[EMAIL PROTECTED] wrote:
>>>How can we define and display the varibles by using for loop
>>>function ?
>>
>>>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. yo
> > How can we define and display the varibles by using for loop
> > function ?
>
> 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] )
and via the varibles of form tag ( format, eg : $_GET["varname"] o
There are two ways of accomplishing what I think you're trying to acomplish.
These ways are known as the right way and the wrong way.
the right way results in an array like
$func = array(0 => 0, 1 => 1, 2 => 2 ...)
The wrong way results in a set of variables like you described
$func1 = 0
$fu
> If I want to define and display a set of varibles, for example :
> $func1 = 0
> $func2 = 1
> $func3 = 2
> $func4 = 3
> $func5 = 4
>
> How can we define and display the varibles by using for loop
> function ?
This uses an array, so, in this case, your variables would be referenced as
$func[0]
4 matches
Mail list logo