Reputation: 601
I have a problem when converting an array of array to array
when I debug a variable named $todaysdata
, It shows below output,
Array
(
[0] => Array
(
[Requestcard] => Array
(
[id] => 954
[userprofile_id] => 14
[userprofile_name] => Syed Imran
[sex] => male
)
)
)
But actually i want the output in in the given format
Array
(
[Requestcard] => Array
(
[id] => 954
[userprofile_id] => 14
[userprofile_name] => Syed Imran
[sex] => male
)
)
If anybody knows. Please help me.
Upvotes: 0
Views: 87
Reputation: 108
The correct syntax for solving the example that you've given would be similar to:
$result_array = $original_array[0];
If you have multiple arrays to move up, you might want to consider PHP's array_merge() function.
Upvotes: 1