dht
dht

Reputation: 41

Unable to decode Json on PHP from API

I am unable to decode Json on PHP, it returns NULL if I do a json_decode()

If I do a var_dump it give me the following json string:

array(12)
{
    ["Type"]=> string(5) "Test"
    ["PIN"]=> int(0)
    ["OwnerId"]=> string(36) "3809fcad-bbcb-4ae2-af48-306565dc13f5"
    ["Name"]=> string(22) "Dummy Simulator Device"
    ["IgnitionOn"]=> NULL
    ["LastGPSEvent"]=> string(36) "87907b6b-4e0b-4726-853c-0fd9777ee764"
    ["CurrentTrip"]=> string(36) "d94c0730-e78b-46df-8001-a94d76113571"
    ["LastContactTime"]=> string(24) "2013-07-12T15:27:04.534Z"
    ["Viewers"]=> NULL
    ["_id"]=> string(28) "SimTest_LLTmkJ3EIavH2RKKYkVf"
    ["_rev"]=> NULL
    ["_deleted"]=> bool(false)
}

Upvotes: 0

Views: 102

Answers (1)

Naftali
Naftali

Reputation: 146310

That is not JSON.

That is already PHP array -- no need to decode anything.

Upvotes: 4

Related Questions