Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Json_decode returns 'NULL' #20

Open
jaspervergers opened this issue Jul 12, 2011 · 2 comments
Open

Json_decode returns 'NULL' #20

jaspervergers opened this issue Jul 12, 2011 · 2 comments

Comments

@jaspervergers
Copy link

Dear Forum,

I have a problem, i am using the sample script to get the ID of a venue. But if i use Json_decode to decode the Json it returns 'NULL' on the screen.

The script:

get('/venues/search',array('ll'=>'52.3655230,4.8853789')); ``` ?>
  <pre><?php var_dump(json_decode($venue->response->groups[0]->items[0])); ?></pre>

Hopefully you guys can help me.

Kind Regards,

Jasper Vergers

@ecdiddy
Copy link

ecdiddy commented Sep 9, 2011

I am having the same problem except I'm getting nothing for the responseText. I'm trying to retrieve venues under userless access.

$fsObj = new EpiFoursquare($key, $secret, NULL );

$venues = $fsObj->get('/venues/search', array('ll' => '40.7,-74'));

@ecdiddy
Copy link

ecdiddy commented Sep 11, 2011

Not sure if anyone else is having the same problem as me but I found the solution.

Inside EpiFourSquare file in the "request" method

I modified the following:

if(isset($_SERVER ['SERVER_ADDR']) && !empty($_SERVER['SERVER_ADDR']) && $_SERVER['SERVER_ADDR'] != '127.0.0.1' )

to....

if(isset($_SERVER ['SERVER_ADDR']) && !empty($_SERVER['SERVER_ADDR']) && $_SERVER['SERVER_ADDR'] != '127.0.0.1' )

.

The $_SERVER value was returning "::1" value which screwed up the binding. I don't have a full understanding to why this is but thought this can help others.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants