title: Facebook API - return friends list (PHP arrays)
body: <p>Im trying to return the friend list of a user using a Facebook app without using the PHP SDK.
  I have managed to return the users name, gender, etc. without using an auth code. Im now trying to return a list of names who are the users friends, all ive managed to do so far is print the array, I cant seem to only print the name as its laid out differently to the users name, gender, etc. which I managed to echo by doing:</p>
  
  <pre><code>$user-&gt;name
  </code></pre>
  
  <p>But when I try that for the friends list it doesnt work and doesnt echo anything at all, I was just wondering if anyone knew how I go about doing this?</p>
  
  <p>Using print_r I get the following:</p>
  
  <pre><code>Array(
  [0] =&gt; Array ( [name] =&gt; Friend's name [id] =&gt; x )
  [1] =&gt; Array ( [name] =&gt; Friend's name [id] =&gt; x )
  [2] =&gt;....)
  </code></pre>
  
  <p>Until all of the friends have been listed.</p>
  
  <hr>
  
  <pre><code> { "name": "Name", 
      "hometown": {
        "id": "Hometown_id", 
        "name": "Hometown"
      }, 
      "id": "Friend_id" }
  </code></pre>
  
  <p>Above is the structure of the array of each, I think a potential issue is that not everybody has a hometown set which may be why I'm receiving a forEach error?</p>