我正在尝试将图像从远程服务器直接上传到fb服务器,但第7行出现错误语法错误告诉我它有什么问题
<?php
require_once("facebook.php");
$config = array();
$config[‘appId’] = 'xxxxxxxxxxxxx';
$config[‘secret’] = 'xxxxxxxxxxxxxxxxxxx';
$config[‘fileUpload’] = true/ optional
$facebook = new Facebook($config);
$attachment = array('message' => 'Want an Amazing Cover for your profile then checkout the link below. ',
'name' =>'xxxxx',
'caption' => "xxxxxxx",
'link' => 'http://apps.facebook.com/xxxxxxxxx/',
'description' => 'xxxxxxxxxxxxxx', //blah blah
'picture' => 'http://xxxxxxxxxxxxxx.com/wp-content/uploads/2012/02/under-construction-fb-cover1.jpg'.$Picturetoupload,
'method'=>'stream.publish',
'actions' => array(array('name' => 'xxxxxxxxxxxxx',
'link' => 'http://apps.facebook.com/axxxxxx/')));
$uid=$fbme['id']; // id of the user
$result = $facebook->api('/'.$uid.'/feed/','post',$attachment);
?>
答案 0 :(得分:4)
你在第6行丢失了一个分号,并且正在使用不正确的评论和引号。
$config[‘fileUpload’] = true/ optional
应该是:
$config['fileUpload'] = true; // optional;