是否可以将图像和链接一起发布?这是我的代码:
try {
$facebook->setFileUploadSupport(true);
if(!isset($userLink)){
$postResult = $facebook->api(
'/'.$userGroupId.'/photos/',
'post',
array(
'message' => $userMessage,
'source' => '@'.$_FILES["source"]["tmp_name"] ));
}else{
$postResult = $facebook->api(
'/'.$userGroupId.'/photos/',
'post',
array(
'message' => $userMessage,
'link' => $userLink,
'source' => '@'.$_FILES["source"]["tmp_name"] ));
}
}
catch (FacebookApiException $e) {
error_log('Could not post image to Facebook.');
}
没有'link'
一切都可以,但是如果我将链接插入数组中,则会出现错误:Notice: Undefined variable: postResult in..
我的代码有问题吗?请帮忙,谢谢。