问题
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?
回答1:
Change your precision
setting in php.ini, or directly in code:
ini_set('precision', 20);
回答2:
You must be using a 32-bit version of PHP, where the largest integer is 2147483647
Try using printf instead of echo:
printf('http://graph.facebook.com/events/%s', $eid);
来源:https://stackoverflow.com/questions/13313401/possible-bug-facebook-events-api-eid-table-values-being-returned-with-decimal-p