I have an array, I want the result to be like this: type id, name. username, password, email.
Array
(
[0] => 1
[id] => 1
[1] => xyz
[name] => xyz
[2] => admin
[username] => admin
[3] => 200820e3227815ed1756a6b531e7e0d2
[password] => 200820e3227815ed1756a6b531e7e0d2
[4] => xyz@gmail.com
[email] => xyz@gmail.com
)
Here this array key [0] and [id] is same, because these are the same as in a table, so you can fetch the value form database like this