语法错误,t_variable

时间:2012-06-06 13:57:18

标签: php syntax-error

我正在尝试将图像从远程服务器直接上传到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);
?>

1 个答案:

答案 0 :(得分:4)

你在第6行丢失了一个分号,并且正在使用不正确的评论和引号。

$config[‘fileUpload’] = true/ optional

应该是:

$config['fileUpload'] = true; // optional;