Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.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 Tumblr API文件\u获取\u内容_Php_Api_File Get Contents_Tumblr - Fatal编程技术网

Php Tumblr API文件\u获取\u内容

Php Tumblr API文件\u获取\u内容,php,api,file-get-contents,tumblr,Php,Api,File Get Contents,Tumblr,我正在尝试使用TumblrAPI,我相信它是JSON。我正在尝试使用Php在下面的URL中获取“posts total”,并将其回显出来。我该怎么做 多谢各位 Update: 我正在尝试使用 $result = json_decode(file_get_contents('http://example.tumblr.com/api/read/json?num=0')); $print_r($result); echo $result[1]; 我有500个错误。当我尝试回显$result

我正在尝试使用TumblrAPI,我相信它是JSON。我正在尝试使用Php在下面的URL中获取“posts total”,并将其回显出来。我该怎么做

多谢各位

Update:
我正在尝试使用

$result = json_decode(file_get_contents('http://example.tumblr.com/api/read/json?num=0'));
$print_r($result); 
echo $result[1]; 

我有500个错误。当我尝试回显$result时,什么也得不到。

简单php-

$result = json_decode(file_get_contents('http://example.tumblr.com/api/read/json?num=0'));
print_r($result); //will show contents return in an araay format
echo $result[1]; //or whatever the element is
简单php-

$result = json_decode(file_get_contents('http://example.tumblr.com/api/read/json?num=0'));
print_r($result); //will show contents return in an araay format
echo $result[1]; //or whatever the element is

我有一个类似的问题,我想我解决了

var tumblr_api_read = {"tumblelog":{"title":"Ex-Sample","description":"A sample document used to provide examples of the various [and <i>varying<\/i>] HTML tags Tumblr puts out. Quote, specifically, has a lot of variants.","name":"example","timezone":"US\/Eastern","cname":false,"feeds":[]},"posts-start":0,"posts-total":"20","posts-type":false,"posts":[]};

我有一个类似的问题,我想我解决了

var tumblr_api_read = {"tumblelog":{"title":"Ex-Sample","description":"A sample document used to provide examples of the various [and <i>varying<\/i>] HTML tags Tumblr puts out. Quote, specifically, has a lot of variants.","name":"example","timezone":"US\/Eastern","cname":false,"feeds":[]},"posts-start":0,"posts-total":"20","posts-type":false,"posts":[]};

我有500个错误。当我只回显$result时,我什么也没有得到。我得到了一个500的错误。当我只回显$result时,我什么也没有得到。我输入了一个错别字-应该是print\r-这可能会抛出你的500错误。。问题是url返回一个带有json的变量,而不仅仅是一个纯jsonI的输入错误-应该是print\r-这可能会引发500错误。。问题是url返回一个带有json的变量,而不仅仅是一个纯json