Re: EZ array problem - What's wrong with my brain?
| From: | Jochem Maas | Date: | Fri, 01 Dec 2006 10:33:28 +0000 |
| Subject: | Re: EZ array problem - What's wrong with my brain? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-245397@lists.php.net to get a copy of this message | ||
Youri LACAN-BARTLEY wrote:
> Well, I've only just fallen out of bed, but I'd say you'd be able to
> access it via $var[0][0][0] as in $var["1.2"]["code"][0] to change 111
> to something else and $var["1.2"]["status"][0] to set/change
> "new".
>
> I must say this looks like an overly complicated array for what it
> serves. A little OOP could come in handy to organize all that in more
> friendly and efficient way ...
efficient? overly-complicated?
php arrays are made for stuff like this.
>
> Brian Dunning wrote:
>> var_dump() gives me this:
>>
>> array(1) {
>> ["1.2"]=>
>> array(2) {
>> ["code"]=>
>> array(1) {
>> [0]=>
>> string(3) "111"
>> }
>> ["status"]=>
>> array(1) {
>> [0]=>
>> string(3) "new"
>> }
>> }
>> }
>>
>> I'm trying to set a variable to that "1.2". Shouldn't I be able to get
>> it with $var = $arr[0][0]?
>>
>> --PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>