Let's say i do a query:
select * from branches
Now, I get a result:
ID | CODE | Name | etc...
1 | ABC | One | etc...
2 | BED | Two | etc...
3 | CPE | Three | etc...
4 | FEE | Four | etc...
I will end up with an array that can be used like this:
$data[0]->name;
I want to change this array so I can call it like this:
$data['ABC']->name;
What is the quickest way to convert an array so that it's key is one of the items in the array? I.e.Preferably without looping and assigning?
array, but an object. You will have to convert it manually with a foreach loop.