Como recorro el json
Publicado por Guille (3 intervenciones) el 08/06/2020 01:48:08
Hola, soy nuevo en php y no se como recorrer el siguiente json:
{"from":1,"to":100,"total":9,"auditData":{"processTime":"26","timestamp":"2020-06-08 01:46:14.948","requestHost":"10.185.88.167","serverId":"ip-10-185-89-253.eu-west-1.compute.internal.node.int-hbg-aws-eu-west-1.discovery","environment":"[awseuwest1, awseuwest1a, ip_10_185_89_253]","release":"f744fdcb9854b96166972f5850c84c228cf5f492","internal":"511e8ce417c24000b1222fa7ee225eea"},"accommodations":[{"code":"APARTMENT","typeMultiDescription":{"languageCode":"ENG","content":"Apartment"},"typeDescription":"Apto"},{"code":"APTHOTEL","typeMultiDescription":{"languageCode":"ENG","content":"Aparthotel"},"typeDescription":"Aparthotel"},{"code":"CAMPING","typeMultiDescription":{"languageCode":"ENG","content":"Camping"},"typeDescription":"Camping"},{"code":"HOMES","typeMultiDescription":{"languageCode":"ENG","content":"Villa"},"typeDescription":"Villa"},{"code":"HOSTEL","typeMultiDescription":{"languageCode":"ENG","content":"Hostel"},"typeDescription":"Albergue"},{"code":"HOTEL","typeMultiDescription":{"languageCode":"ENG","content":"Hotel"},"typeDescription":"Hotel"},{"code":"PENDING","typeMultiDescription":{"languageCode":"ENG","content":"Pending Category"},"typeDescription":"Pendiente Categoria"},{"code":"RESORT","typeMultiDescription":{"languageCode":"ENG","content":"Resort"},"typeDescription":"Resort"},{"code":"RURAL","typeMultiDescription":{"languageCode":"ENG","content":"Rural"},"typeDescription":"Agroturismo"}]}
Necesito recorrer cada uno de los "accommodations". Alguien me podría ayudar a codificarlo???
Saludos y muchas gracias.
{"from":1,"to":100,"total":9,"auditData":{"processTime":"26","timestamp":"2020-06-08 01:46:14.948","requestHost":"10.185.88.167","serverId":"ip-10-185-89-253.eu-west-1.compute.internal.node.int-hbg-aws-eu-west-1.discovery","environment":"[awseuwest1, awseuwest1a, ip_10_185_89_253]","release":"f744fdcb9854b96166972f5850c84c228cf5f492","internal":"511e8ce417c24000b1222fa7ee225eea"},"accommodations":[{"code":"APARTMENT","typeMultiDescription":{"languageCode":"ENG","content":"Apartment"},"typeDescription":"Apto"},{"code":"APTHOTEL","typeMultiDescription":{"languageCode":"ENG","content":"Aparthotel"},"typeDescription":"Aparthotel"},{"code":"CAMPING","typeMultiDescription":{"languageCode":"ENG","content":"Camping"},"typeDescription":"Camping"},{"code":"HOMES","typeMultiDescription":{"languageCode":"ENG","content":"Villa"},"typeDescription":"Villa"},{"code":"HOSTEL","typeMultiDescription":{"languageCode":"ENG","content":"Hostel"},"typeDescription":"Albergue"},{"code":"HOTEL","typeMultiDescription":{"languageCode":"ENG","content":"Hotel"},"typeDescription":"Hotel"},{"code":"PENDING","typeMultiDescription":{"languageCode":"ENG","content":"Pending Category"},"typeDescription":"Pendiente Categoria"},{"code":"RESORT","typeMultiDescription":{"languageCode":"ENG","content":"Resort"},"typeDescription":"Resort"},{"code":"RURAL","typeMultiDescription":{"languageCode":"ENG","content":"Rural"},"typeDescription":"Agroturismo"}]}
Necesito recorrer cada uno de los "accommodations". Alguien me podría ayudar a codificarlo???
Saludos y muchas gracias.
Valora esta pregunta
0