Posted by Tom Peel on 09/28/11 11:41
Good Man wrote:
> Tom Peel <notreallytandp@freenet.de> wrote in
> news:46qs8bFcjg1qU1@individual.net:
>
>
>>This is pretty ugly, because I cannot predict the final size of the
>>array.
>>
>>Is there a good solution?
>
>
> if(array_key_exists($k,$constraintuno)) {
> $constraintuno[$k] .= $s." + ";
> }
>
> might work?
>
and if the key doesn't exist? Once again, the point is that I am
trying to insert an item into an array at a key position that doesn't
exist yet, and I have no way a priori to know which keys will exist.
Surely this cannot be so unusual?
[Back to original message]
|