Been a long time since I visited it DaniWeb :)
I have a very wiered problem with my JSON data I'm getting using CURL.
The returned json is 100% valid - you can copy and check it from here: http://pastebin.com/mdF1Vd7k
When I try to do the following:
$result->data->username; it shows nothing at all. Any idea why?
Here is my JSON Code:
$curl = curl_init($url); //configure our curl $options= array( CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => array('Content-type: application/json') ); //set the options to curl object curl_setopt_array($curl, $options); $result = curl_exec($curl);
PS: I know I can decode it to an Array which actually worked fine, but I don't like arrays. I like using it as an object as is.
Thanks in advance!