i am trying to install a sdk on a public cloud service.The code is shown as follow:
<?php
echo ( '<meta charset="utf-8">');
date_default_timezone_set('PRC');
require_once __DIR__ . '/lib/KdtApiClient.php';
$appId = 'xxx';
$appSecret = 'xxx';
$client = new KdtApiClient($appId, $appSecret);
$method = 'kdt.users.weixin.followers.get';
$params = [
// 'tid' => 'E20150126200526848473',
//'num_iid' => 1005950256201501260011172648,
//'title' => 'api 测试商品 编辑 __ 22',
//'desc' => 'description here',
//'post_fee' => 0.2,
'page_size'=>5000,
];
$files = [
[
'url' => __DIR__ . '/file1.png',
'field' => 'images[]',
],
[
'url' => __DIR__ . '/file2.jpg',
'field' => 'images[]',
],
];
echo '<pre>';
var_dump(
$client->post($method, $params, $files)
);
echo '</pre>';
?>
I got this error:
Parse error: syntax error, unexpected '[' in php-sdk/index.php on line 12
The code works well on local xampp.Is there anyone can tell me what's the problem?
$arr = array(...);