Riyaz saifi Riyaz saifi - 8 months ago 50
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.


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:-