Php 将with modifier与facebook API一起用于用户位置

Php 将with modifier与facebook API一起用于用户位置,php,facebook,facebook-graph-api,Php,Facebook,Facebook Graph Api,我正在尝试从me/feed 像这样 if ($user) { try { $user_profile = $facebook->api('/me'); $friends = $facebook->api('/me/friends'); $feeds = $facebook->api('/me/feed', array ( 'with' => 'location', )); } catch (FacebookApiExc

我正在尝试从
me/feed

像这样

if ($user) {
  try {
    $user_profile = $facebook->api('/me');
     $friends = $facebook->api('/me/friends');
    $feeds = $facebook->api('/me/feed', 
  array (
    'with' => 'location',
  )); 
  } catch (FacebookApiException $e) {
    error_log($e);
    $user = null;
  }
}
当我打印这篇文章时,它会给我整个提要,而不仅仅是API所说的带有位置的文章。。。

这是我的全部代码

<?php        
require 'facebookAPI/src/facebook.php';

$facebook = new Facebook(array(
  'appId'  => '0000000',
  'secret' => '000000000',
));

$user = $facebook->getUser();

if ($user) {
  try {
    $user_profile = $facebook->api('/me');
     $friends = $facebook->api('/me/friends');
    $feeds = $facebook->api('/me/feed', 
  array (
    'with' => 'location',
  )); 
  } catch (FacebookApiException $e) {
    error_log($e);
    $user = null;
  }
}

if ($user) {
$params = array( 'next' => 'http://www.wuno.com/sandbox/actions/fbLogout.php' );
$logoutUrl = $facebook->getLogoutUrl($params);
} else {
  $loginUrl = $facebook->getLoginUrl(array(
    'scope' => 'user_about_me, user_checkins, friends_checkins, user_location, friends_location, read_stream')
  );
}
?>


您是否将
打印
$feed
$facebook->api('/me/feed')
作为
打印($facebook->api('/me/feed'));)?我像这样打印($facebook->api('/me/feed');在这种情况下,您没有发送参数
?with=location
,或者在您的情况下发送数组
$p=array('with'=>'location')
,那么我该如何打印它呢?打印($facebook->api('/me/feed',GET,array('with'=>'location',);是的,尝试一下,并引用GET-like
'GET'
<?php        
require 'facebookAPI/src/facebook.php';

$facebook = new Facebook(array(
  'appId'  => '0000000',
  'secret' => '000000000',
));

$user = $facebook->getUser();

if ($user) {
  try {
    $user_profile = $facebook->api('/me');
     $friends = $facebook->api('/me/friends');
    $feeds = $facebook->api('/me/feed', 
  array (
    'with' => 'location',
  )); 
  } catch (FacebookApiException $e) {
    error_log($e);
    $user = null;
  }
}

if ($user) {
$params = array( 'next' => 'http://www.wuno.com/sandbox/actions/fbLogout.php' );
$logoutUrl = $facebook->getLogoutUrl($params);
} else {
  $loginUrl = $facebook->getLoginUrl(array(
    'scope' => 'user_about_me, user_checkins, friends_checkins, user_location, friends_location, read_stream')
  );
}
?>