-----Original Message-----
From: Mike Morton
To: David Otton

Look - David - I do appreciate your efforts to help - and I realize that
working blind on an email list is tough, but the question is not about
the
structure of the code, the database, reserved words or anything else.

The question for anyone out there is simple - does array_push allow you
to
push key=>value pairs?

--------------------------

No.

The manual is really clear on this one when it says array_push($array, $var)
has the same effect as $array[] = $var.  Applying this to your question: if
you could do $array[] = $k=>$v then you could do array_push($array, $k=>$v),
but you can't so you can't.

Having said that, I've just given you a clue: since array_push($array, $var)
is equivalent to $array[] = $var, you can get the result you want by doing:

   $array[] = array($k, $v);

(with, of course, appropriate values for $array, $k and $v substituted to
suit your code!).

Cheers!

Mike

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to