title: Facebook Graph API (How to get user gender?)
body: <p>I'm working on PHP project. I have to get id, fullname, firstname, gender and email of the user. I got id of the user. So, It is clear that there is no any problem in PHP facebook-sdk or Facebook library. But I can not get other fields. So, ther is something is wrong in my code. But I can't find that wrong code. If anyone know answer then please explain or suggest me link from where I can understand from beginning. Thank You. Here is my code. Here is my code.</p>
  
  <pre><code>$request = new FacebookRequest($session, 'GET', '/me');
  $response = $request-&gt;execute();
  
  // get response
  $graphObject = $response-&gt;getGraphObject();
  
  $fbid = $graphObject-&gt;getProperty('id');         // To Get Facebook ID
  
  echo $fbid;    //working as I'm getting facebook ID
  
  $filenameIn = 'https://graph.facebook.com/' . $fbid . '/fields=gender';
  $gender = file_get_contents($filenameIn);
  echo $gender;    //I can not get this.
  </code></pre>