has the following data table
then output json data like this at once:
$.rawCitiesData = [
{
"name":"",
"code":"id",
"sub": [
{
"name": "",
"code": "id",
"sub":[
{
"name":"",
"code":"110101"
},
{
"name":"",
"code":"110102"
},
{
"name":"",
"code":"110105"
},
{
"name":"",
"code":"110106"
},
{
"name":"",
"code":"110107"
},
{
"name":"",
"code":"110108"
},
{
"name":"",
"code":"110109"
},
{
"name":"",
"code":"110111"
},
{
"name":"",
"code":"110112"
},
{
"name":"",
"code":"110113"
},
{
"name":"",
"code":"110114"
},
{
"name":"",
"code":"110115"
},
{
"name":"",
"code":"110116"
},
{
"name":"",
"code":"110117"
},
{
"name":"",
"code":"110228"
},
{
"name":"",
"code":"110229"
}
]
}
]
},
< H2 > only the id and name fields in the output data table do not need < / H2 >
data table description
pid=0 means top-level classification
child if equal to 1 means there are subordinate categories
also ask God to teach me how to write this php