PDA

View Full Version : Array Change a value


MrRundog
04-23-2008, 11:15 AM
Hi folks, A little array thing I can't figure (Trial and error solution just aint working this mornin')

Given that I know the Key of the array - what is the code to ALTER the QTY part of the associate array

Array
(
[0] => Array
(
[19] => Array
(
[Qty] => 12
)

)

[1] => Array
(
[20] => Array
(
[Qty] => 6
)

)

)

Many Thanks in anticipation

idalatob
04-23-2008, 11:17 AM
assuming $arr_s is your array:

$arr_s[0][19]['qty'] = 'new value';

MrRundog
04-23-2008, 11:52 AM
Thanks - That worked - If only everything in life was a simple