Re: Array Push and Keys
| From: | David Otton | Date: | Fri, 29 Aug 2003 16:22:42 +0000 |
| Subject: | Re: Array Push and Keys | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-161156@lists.php.net to get a copy of this message | ||
On Fri, 29 Aug 2003 11:18:18 -0400, you wrote:
>The question for anyone out there is simple - does array_push allow you to
>push key=>value pairs? That is what is causing errors - nothing else,
>everything else is a result of inherited systems, and other developers
>crappy design. I agree with you David on all the issues that you bring up -
>date IS a reserved word - but it still works - that is the previous
>developers mentality anyhow :)
>Fair if I was coding for anyting other than a one time report - I am not
>going to spend a great deal of time with 'proper' coding for a one time
>report that does not matter beyond it working once.
This list is used as a learning resource by a lot of people, not just thee
and me. If I didn't correct an error when I saw it, I might be causing
someone to think that was valid code.
>> $data[$dealerid][$country] = $amount;
>
>This is what I am doing now, and yes it works, but this does not answer my
>original question.
Yeah, I see that now - I'm sorry that we ended up talking at cross-purposes.
In my defence you posted a large lump of code, including database queries,
so I assumed you were asking the standard "how do I get this code to produce
this structure" question, rather than asking about the behaviour of a single
function.
The question quoted above (first paragraph) is much clearer, and got you an
answer from Mike Ford within 15 minutes. There's a lesson for both of us
here :)