[PHP] unshift a key value pair

2002-01-09 Thread Marc Logghe
Hi, I was wondering how you could unshift a key value pair onto an array. In the manual one suggested using a function like this: function array_unshift_assoc($arr, $key, $val) { $arr = array_reverse($arr, true); $arr[$key] = $val; $arr = array_reverse($arr, true); return

Re: [PHP] unshift a key value pair

2002-01-09 Thread Marc Logghe
Original Message - From: Marc Logghe [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, January 09, 2002 10:55 AM Subject: [PHP] unshift a key value pair Hi, I was wondering how you could unshift a key value pair onto an array. In the manual one suggested using a funct

[PHP] Re: unshift a key value pair

2002-01-09 Thread Marc Logghe
. Thanks for your fast response Marc Cc Zona [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Marc Logghe) wrote: So it is really easy to *remove* a key-value pair, but how do you put one in ? $arr[$k

[PHP] strange problem

2002-01-18 Thread Marc Logghe
Hi, my PHP (PHP Version 4.1.1) suddenly does not take this anymore: $a['color'] = 'red'; I get this error: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' when I remove the quotes around the key, it works. Problem is , that a certain key is %coding (I know, I