Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/242.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
php Github Gist API创建数组内容不是字符串_Php_Arrays_Github Api_Gist - Fatal编程技术网

php Github Gist API创建数组内容不是字符串

php Github Gist API创建数组内容不是字符串,php,arrays,github-api,gist,Php,Arrays,Github Api,Gist,各位, 我使用以下API: 我的脚本如下所示: include_once('includes/gist_api.php'); $gistAPI=新的gistAPI('USERNAME','PASSWORD'); 函数create\u githubgist($text、$title、$public=false){ 全球$gistAPI; $filesArray=array(“file1.txt”=>array(“content”=>“一些随机内容”); $newGist=$gistAPI->cre

各位,

我使用以下API:

我的脚本如下所示:

include_once('includes/gist_api.php');
$gistAPI=新的gistAPI('USERNAME','PASSWORD');
函数create\u githubgist($text、$title、$public=false){
全球$gistAPI;
$filesArray=array(“file1.txt”=>array(“content”=>“一些随机内容”);
$newGist=$gistAPI->createGist($filesaray,'createbytest',$public);
返回$newGist;
}
$image\u githubgist=create\u githubgist('tEST','testtesttest',false);
/*变量转储($image\u gitubgist)*/
回声'
对于“properties/content\”,{“content”=>“Some Random content”}不是字符串,
'文档url'=>''

我非常感谢你的帮助

编辑我自己:
我自己能够纠正它:

如果您遵循了正在使用的库的文档,但它仍然不起作用,您应该与开发人员联系(在他们的gtihub上添加一个问题)。当您的代码出现问题时也是如此。我们不是来帮你调试别人的代码的。我看到您已经在他们的github上创建了一个问题。然后你应该等待他们的回复,而不是在这里发布。这个库在5年内没有更新,可能已经被弃用了。试着找一个新的。不幸的是,我找不到替代品。我只想能够创建、编辑和删除GIST。因为我的Web空间上没有安装composer,所以我不能使用任何其他API:/我自己能够纠正它:如果您已经遵循了您正在使用的库的文档,但它仍然不起作用,那么您应该与开发人员联系(在他们的gtihub上添加一个问题)。当您的代码出现问题时也是如此。我们不是来帮你调试别人的代码的。我看到您已经在他们的github上创建了一个问题。然后你应该等待他们的回复,而不是在这里发布。这个库在5年内没有更新,可能已经被弃用了。试着找一个新的。不幸的是,我找不到替代品。我只想能够创建、编辑和删除GIST。因为我的Web空间上没有安装composer,所以我不能使用任何其他API:/我自己能够纠正它:
'message' => 'Invalid request.