PHP generates JSON files
JSON file
{
Title: "Site Name",
Link: "/HTTP-site address. com/list_1/index.html",
Description: "Introduction",
Item: [
{
Title: "Heading Title 1",
Link: "/HTTP Content address 1.html",
Pdate: "2014-03-01 00:00:00",
Summary: Body body Body Body Body,
Imgurl: "http//Picture 1.jpg|http://picture 2.png|http://picture 3.gif"
},
{
Title: "Heading Title 2",
Link: "/HTTP Content address 2.html",
Pdate: "2014-03-01 00:00:00",
Summary: Body body Body Body Body,
Imgurl: "http//Picture 1.jpg|http://picture 2.png|http://picture 3.gif"
}
]
}
Inside the content is read from the database how can I generate it with PHP?
------to solve the idea----------------------
It's already in JSON format, just print.
------to solve the idea----------------------
Can parse the group AH. Json_decode ($json, true);
------to solve the idea----------------------
Copy it out, add double quotes to all keys, and then restore with Json_decode () is the array you need.
------to solve the idea----------------------
Json_decode ()