How would I insert a key => value pair into the midst of a nested array?
example:
array
1 => string 'a' (length=1)
2 => string 'b' (length=1)
3 =>
array
'this' => string 'that' (length=4)
'meh' => string 'foo' (length=3)
'blah' =>
array
'a' => int 1
'b' => int 2
4 =>
array
'this' => string 'that' (length=4)
'meh' => string 'foo' (length=3)
'blah' =>
array
'a' => int 1
'b' => int 2
How would I add x=>1
to every second level of array... so I would get this:
array
1 => string 'a' (length=1)
2 => string 'b' (length=1)
3 =>
array
'this' => string 'that' (length=4)
'meh' => string 'foo' (length=3)
'blah' =>
array
'a' => int 1
'b' => int 2
'x' => int 1 //Here's the added bit
4 =>
array
'this' => string 'that' (length=4)
'meh' => string 'foo' (length=3)
'blah' =>
array
'a' => int 1
'b' => int 2
'x' => int 1 //Here's the added bit