I first use SQL to query out the data in the database, and then traverse it, and finally use Json_encode encoded output, the output is not JSON type, I ask you the great God, how to solve, extremely grateful!
Reply to discussion (solution)
That's JSON data, and you're not going to say JSON-type.
The result of your output is JSON type, but you look at the words is a bit of a problem, you go to Baidu online JSON format, put your data in the format of the line, but this data does not affect your query results, just JSON display problems.
The result looks really json, but I use AJAX parsing in JS to get the result as follows:
1, I write datatype in Ajax as JSON, what results can not get
2, I commented out the datatype, and then output data, resulting in a string
That's why I don't understand it here.
Where did this come from? Does it count as JSON?
Put in the < p=""> html
The result looks really json, but I use AJAX parsing in JS to get the result as follows:
1, I write datatype in Ajax as JSON, what results can not get
2, I commented out the datatype, and then output data, resulting in a string
That's why I don't understand it here.
This is because you have this page and HTML code, so you $phptest in Echo; Exit, add this exit; Stop the output, remember not to use PHP to output HTML code
Thank you, great God, the problem has been solved.