Posted by somaboy mx on 06/01/05 14:29
Hello,
I need to do the following:
Say I have a multidim array:
$array = array();
$array[0]['name'] = 'Kevin';
$array[0]['age'] = 23;
$array[1]['name'] = 'Julia';
$array[1]['age'] = 31;
$array[2]['name'] = 'Bob';
$array[2]['age'] = 26;
$array[3]['name'] = 'Drew';
$array[3]['age'] = 37;
and I have a seperate array:
$person = array();
$person['name'] = 'Dana';
$person['age'] = 33;
now I want to insert the $person array into the $array in such a way
that it ends up at index 1 and the subsequent elements get pushed up and
renumbered, so $array[1] becomes $array[2] and so on.
Does php have a built-in function that does this?
..soma
[Back to original message]
|