i fetch the user's group in facebook using graph api...
http://developers.facebook.com/tools/explorer?method=GET&path=100000004811603%2Fgroups / with user_groups
permission and a valid access_token
i turned it into array using this function i found in google:
function objectToArray($d) {
if (is_object($d)) {
// Gets the properties of the given object
// with get_object_vars function
$d = get_object_vars($d);
}
if (is_array($d)) {
/*
* Return array converted to object
* Using __FUNCTION__ (Magic constant)
* for recursive call
*/
return array_map(__FUNCTION__, $d);
}
else {
// Return array
return $d;
}
}
now i have the the results in this variable
$groups = objectToArray($obj);
and now what i want to do is to extract the values of id
keys and put it in an array that will looks like this:
$new = array("group id 1","group id 2","group id 3","group id 4"); // and so on....
can someone help me plsss