I have to deserialize a dictionary in PHP that was serialized using cPickle in Python. In this specific case I probably could just regexp the wanted information, but is there a better way? Any …
Tag: json
Handling big user IDs returned by FQL in PHP
I’m using FQL to retrieve a list of users from Facebook. For consistency I get the result as JSON. This causes a problem – since the returned JSON encodes the user IDs as numbers, json_decode() …
Invalid JSON parsing using PHP
I’m pulling a JSON feed that is invalid JSON. It’s missing quotes entirely. I’ve tried a few things, like explode() and str_replace(), to get the string looking a little bit more like valid JSON, but with an associate JSON string inside, it generally gets screwed up. Here’s an example: Are there any JSON parsers for php out there that can
Access JSON object name in PHP
I have the following JSON: { “nickname”: “xadoc”, “level”: 4, “loc”: “Tulsa, OK, USA”, “score”: 122597, “money”: 29412.5, “streetNum”: 8, “streets”: { “-91607259/387798111”: { …
Performance considerations of JSON vs. XML
I am using a webservice which provides a large result set either in XML or JSON format. Which format will be faster or better (perfomance based)? Also which language should I use to parse the XML/JSON?…
Cyrillic characters in PHP’s json_encode
I’m trying to encode Cyrillic UTF-8 array to JSON string using php’s function json_encode. The sample code looks like this: ‘първи’, ‘две’ => ‘втори’…