How to get the friendlist and post to their wall?

How to get the friendlist when/after registering and post to their wall?

(in class_wdfb_model.php)
Would you just use $friends = $this->fb->api('/me/friends'); or $friends = $this->fb->api('/friends'); or something? And how to access it then? As the api-method returns JSON decoded I guess there will be some (multidimensional) array with the name of the friend and at least the id, right?