my php
if($user){
try{
$user_profile = $facebook->api('/me');
$params = array('next' => 'website' );
$logout =$facebook->getLogoutUrl($params);
$_SESSION['User']=$user_profile;
foreach ($user_profile['education'] as $education) { // <-ERROR HERE
if ($education['type'] == "College") {
$college = $education;
break;
}
}
if(empty($college)) {
echo "College information was not found!";
} else {
// var_dump($college);
$_SESSION['type'] = $college;
print_r($college);
}
page return
Array ( [school] => Array ( [id] => 156029264583245 [name] => Universiti Tunku Abdul Rahman ) [type] => College )
i tried so many way to get it out , but none of them is working.they all return php error , my intention is echo the name of the school and store it into $SESSION. but i cant even get the echo the school name only. what am i going to do get the array data ? thank you
tried this also
$college = json_decode($education, true);
echo $college[1]["name"];
not working.