Riyaz saifi Riyaz saifi - 1 year ago 155
PHP Question

How To Get user birthday Info graph api

I want get user DOB info using Facebook graph API. I got full dob but i need only Day and month

$graph_url ="https://graph.facebook.com/me?fields=id,first_name,name,gender,location,birthday&access_token=" . $accessToken;
$user = json_decode(get_html($graph_url));

echo $user->birthday

The output is
any way to get only Month and days.

Answer Source

As you said that you want number like 8/5 from your birthday that is coming. So you have to do simply:-

echo date('m/d',strtotime( $user->birthday));

To check date formats:-


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download