I am working with a web service that returns JSON data, which, when I decode with PHP's json_decode function, gives me an array like the following:
Array
(
[0] => eBook
[1] => 27
[2] => Trade Paperback
[3] => 24
[4] => Hardcover
[5] => 4
)
Is there a PHP function that will take this array and combine it into an associative array where every other element is a key and the following element is its value? What I want to come up with is the following:
Array
(
[eBook] => 27
[Trade Paperback] => 24
[Hardcover] => 4
)