Q:

Attempting to use an array within an array to store and retrieve data. Having some isses

I have a loop iterating through various users (the counter is simply determining how many users to parse through). In every iteration a user's id and distance are stored in Array $friendObj. Then I want to add the $friendObj array to the $friendsArry. It does this, but each user iteration it replaces the data at the $friendArry[0] spot. Out of the five echo's at the end, only the first one displays anything and that data is the id of the very last user processed. Any suggestions to alter (or completely change my code) would be great (kind of new to php). 
//...
//There is a loop above this cycling through different users.

        $friendObj = array('id' => $fId, 'distance' => $distanceFromYou);
        $friendsArry = array();
        array_push($friendsArry, $friendObj);
        echo "<br />";

        if($counter >= 5)
        {
            break;
        }
    } //end of loop
        echo "Test1: ". $friendsArry[0]['id']. "<br />";
        echo "Test2: ". $friendsArry[1]['id']. "<br />";
        echo "Test3: ". $friendsArry[2]['id']. "<br />";
        echo "Test4: ". $friendsArry[3]['id']. "<br />";
        echo "Test5: ". $friendsArry[4]['id']. "<br />";

A:

Try deleting this line:
 $friendsArry = array($friendInc => friendObj);

I don't even understand what are you doing with that one.. o.O

