Got a rather quick one for you guys if you got time.
I am looking for a 1 liner PHP solution to do this. (not sure if it is possible through the array functions)
Basically I want to remap an array based on the one item present in each.
Example
array(
[0] => array(
[id] => 1234,
[name] => blah
[properties] => whatever
),
[1] => array(
[id] => 5678,
[name] => blah2
[properties] => foobar
)
);
I want to take this array and map it to
array( [1234] => array(
[name] => blah,
[properties] => whatever
),
[5678] => array(
[name] => blah2
[properties] => foobar
));
Basically remapping the array to one of the items present in each element. I am currently using a tempArray and looping through and this works fine but I was curious if there was a 1 line way using the array functions (possibly combining a few) to make a one line php call to do the same thing.