Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.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
wp-load.php添加一些存储我的JSON的空字符_Php_Wordpress - Fatal编程技术网

wp-load.php添加一些存储我的JSON的空字符

wp-load.php添加一些存储我的JSON的空字符,php,wordpress,Php,Wordpress,我尝试创建json页面,以便其他服务器能够获取我的信息。 在php文件的开头,我包含了wp-load.php文件,因为我在代码中使用了一些wordpress函数。 问题是这个文件在文件中添加了一个空的char->“”,现在json的语法是错误的。(“JSON字符串有效,但JSON数据不准确”) 我能做什么 JSON: PHP: {“喜欢”:“#Msg11456622,#Msg11456702,#Msg11456709”,“跟随”:“0”,“forumFavorite”:“0”,“ForumFol

我尝试创建json页面,以便其他服务器能够获取我的信息。 在php文件的开头,我包含了wp-load.php文件,因为我在代码中使用了一些wordpress函数。 问题是这个文件在文件中添加了一个空的char->“”,现在json的语法是错误的。(“JSON字符串有效,但JSON数据不准确”) 我能做什么

JSON:

PHP:

{“喜欢”:“#Msg11456622,#Msg11456702,#Msg11456709”,“跟随”:“0”,“forumFavorite”:“0”,“ForumFollowered”:“0”,“myAdmin”:“0”}

请发布代码,不仅仅是添加的json.added,问题是创建json的语法。我向外部验证器检查。您这样做是错误的。完全错了。编写一个实际的,用于钩住或钩子,呈现json,然后
die()
。像什么样的封面会有用。
{"liked":"#Msg11456622,#Msg11456702,#Msg11456709","followed":"0","forumFavorite":"0","forumFollowed":"0","myAdmin":"0"}  
<?php
header( "Content-Type: application/json" );
require_once('../../../../wp-load.php');
?>{"liked":"#Msg11456622,#Msg11456702,#Msg11456709","followed":"0","forumFavorite":"0","forumFollowed":"0","myAdmin":"0"}