I have the following array structure:
Array ( [0] => Array ( [1] => Array ( [0] => 1 [1] => 4 ) ) )
What I want to be able to do is add values to the third nested array.
How would I do this?
Edit array values [SOLVED]
Moderator: General Moderators
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Edit array values [SOLVED]
Last edited by aceconcepts on Wed Apr 09, 2008 10:50 am, edited 1 time in total.
- EverLearning
- Forum Contributor
- Posts: 282
- Joined: Sat Feb 23, 2008 3:49 am
- Location: Niš, Serbia
Re: Edit array values
if you want to add values to the third nested array, so it looks, for example, like this
do this:
Code: Select all
array
0 =>
array
1 =>
array
0 => int 1
1 => int 4
2 => string 'asdfadsfa' (length=9)
'test' => string 'testxxxx' (length=8)
Code: Select all
$array[0][1][] = 'asdfadsfa'; // if the key value doesn't matter
$array[0][1]['test'] = 'testxxxx'; // if you want to set a specific key- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: Edit array values
Nice one, i'll give it a whirl 
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: Edit array values
It worked - excellent.
Thank you.
Thank you.