[英]Getting Json output, display in php USING REST PHP
I have written Rest Api in python. 我用Python写了Rest Api。 and output comes in json format.
输出为json格式。
Like http://api.myserver.com/v0/movies 像http://api.myserver.com/v0/movies
it will give me output in json format: 它会以json格式输出:
[
{"id":"1","movie_name":"Toy story","genre":["children","action"]},
{{"id":"2","movie_name":"Jab tak hai jaan","genre":["romance","Drama"]}}
]
Now I want output in readable format using PHP. 现在,我想使用PHP以可读格式输出。
I heard that there is some concept of REST php. 我听说有一些REST php概念。 Which get output and store it in $rest variable and after that we can use it .
哪个获取输出并将其存储在$ rest变量中,之后我们就可以使用它了。 So can somebody tell me how to do this problem.
所以有人可以告诉我该怎么做。
Thanks. 谢谢。
use json_decode($json_string, true);
使用
json_decode($json_string, true);
which will give you array 这会给你数组
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.