如何在PHP中创建Json [英] how to Create Json in Php
本文介绍了如何在PHP中创建Json的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在Php中创建像这样的Json?
How to Create Json Like This In Php?
[
[
"16226281",
"11",
"Disclosure.1994.720p.BluRay.H264.AAC-RARBG",
"finished"
],
[
"16226038",
"140",
"Courage The Cowardly Dog (1999-2002)",
"finished"
],
[
"16226020",
"101",
"[R.G. Mechanics] Call of Duty 4 Modern Warfare",
"finished"
]
]
我在互联网上搜索了很多东西,但没有得到任何结果.
I search a lot on the internet but couldn't get any result.
推荐答案
$arr = [
[
"16226281",
"11",
"Disclosure.1994.720p.BluRay.H264.AAC-RARBG",
"finished"
],
[
"16226038",
"140",
"Courage The Cowardly Dog (1999-2002)",
"finished"
],
[
"16226020",
"101",
"[R.G. Mechanics] Call of Duty 4 Modern Warfare",
"finished"
]
]
echo json_encode($arr);
关注以下链接:
http://php.net/manual/en/function.json -encode.php
这篇关于如何在PHP中创建Json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文