Search code examples
phpfacebookfacebook-graph-apifacebook-events

Possible Bug: Facebook Events API eid table values being returned with decimal points raw


I built a custom wordpress widget months ago that just pulls a users facebook events, styles and shows it in the sidebar. The events are still showing up fine - except that the links now go to an facebook error page. So I checked the echo'd url and this is what I got :

https://www.facebook.com/events/4.3772330960996E+14

Obviously the url, ending at events/ is hard-coded and the number that follows is an echo is a for loop. Which has been working clean for about 6mo.

At first I thought maybe it was returning an Integer that was being converted somehow.. but I checked the actual event id from facebook.com and this is what is was:

437723309609959

I think fb api is putting a decimal point where it had never been before.

Just to clarify: I am using PHP - using FQL through the GRAPH with CURL. And then echoing the raw row info.

Thoughts?


Solution

  • Change your precision setting in php.ini, or directly in code:

    ini_set('precision', 20);