|
Posted by Kees Boer on 07/24/05 07:03
Thank you for the reply. You must be Dutch. I'm too.
Let me ask you on this reply. Which words are variables and which are
reserverd words?
$array = array_fill(0, 32, array(array()))
What is array_fill? Is that a reserved word or just some variable that was
made up. What does array(array()) do?
Thanks!
Kees
"Janwillem Borleffs" <jw@jwscripts.com> wrote in message
news:42e2b77d$0$9253$dbd4f001@news.euronet.nl...
> Kees Boer wrote:
>> Hi, I'm trying to create a two diminesional array in PHP with 32 rows
>> and 2 columns. I've been looking on line and in a PHP book, but they
>> don't seem to discuss it much in there.
>>
>> I know in other languages, I've been able to write
>>
>> dimension inventory(32,2)
>>
>> and the array is declared, if I wanted to do an array dealing with
>> inventory for example.
>>
>> How do you do that in PHP.
>>
>
> If you want to define this array before using it, you might want to use
> array_fill():
>
> ;
>
> On the other hand, in PHP it's not required to define an array this way,
> because unlike some other languages, PHP handles array sizing
> automatically. The only way of limiting the size of an array is to stop
> appending values to it . You can simply start with a simple array
> declaration and build it up along the way:
>
> $array = array();
> $array[] = array();
> $array[0] = array();
> $array[0][] = 'value';
>
>
> JW
>
>
>
Navigation:
[Reply to this message]
|