Je dois de mon côté l'utiliser en PHP, et je n'arrive malheureusement pas à utiliser le code tel quel, PHP ayant apparemment besoin d'une syntaxe parfaite, alors que JavaScript permet une syntaxe beaucoup plus permissive.
Voici le code en question :
{'TLS': {'depAirportName': 'Toulouse', 7: {'standard': {'availableDatesAvailable': 'True', 'availableItemMetaData': ['11/2011', '12/2011', '1/2012', '2/2012', '3/2012'], '27/11/2011': {'skuId': '910329858', 'returnArrivalDate': '20111204T00:00:00', 'returnDepartureDate': '20111204T00:00:00', 'AI': {'boardTypeDescription': 'Formule tout compris', 'allocatedRooms': ['2-1'], 'totalRoomAllocationPrice': 858.0, 'rooms': [{'minAdultOccupancy': 2, 'roomTypeName': 'Chambre 2 personnes', 'totalRoomPrice': {'productPrice': 858.0}, 'roomTypeId': '2', 'roomPassengers': [{'passengerPrice': {'boardTypeSupplement': {'productPrice': 0.0}, 'roomTypeSupplement': {'productPrice': 0.0}, 'finalPrice': {'productPrice': 334.0}, 'holidayOptions': [{'priceDisplayStrings': [], 'baseOption': {'optionInternalCode': 'null', 'skuId': '460145316', 'price': 4.0, 'ruleTypeId': 29, 'longDescription': u'Taxe de solidarit\ufffd', 'productTypeId': 24, 'externalId': 'null', 'shortDescription': u'Taxe de solidarit\xe9 4 eur', 'id': 460145316, 'productId': '431713543'}, 'optionStyle': 'MANDATORY', 'maxQuantity': 0, 'quantity': 2}, {'priceDisplayStrings': [], 'baseOption': {'optionInternalCode': 'null', 'skuId': '829419763', 'price': 91.0, 'ruleTypeId': 29, 'longDescription': 'Taxes Obligatoires ', 'productTypeId': 24, 'externalId': 'null', 'shortDescription': 'Taxes Obligatoires 91 eur', 'id': 829419763, 'productId': '431713543'}, 'optionStyle': 'MANDATORY', 'maxQuantity': 0, 'quantity': 2}], 'priceModifierType': {'id': 4, 'description': 'Adult price'}, 'brochurePrice': {'productPrice': 0.0}, 'finalPriceWithSupplements': {'productPrice': 334.0}, 'allInclusivePrice': {'productPrice': 429.0}, 'allInclusiveBrochurePrice': {'productPrice': 0.0}}, 'person': {'passengerType': {'passengerTypeId': 1, 'passengerTypeName': 'Adult'}}, 'quantity': 2}], 'quantity': 1}], 'allInclusivePrice': 429.0}, 'departureArrivalDate': '20111127T00:00:00', 'ticketOnDeparture': ''}}}}, 'availableRooms': {'standard': [{'roomTypeId': '3', 'minAdultOccupancy': 2, 'roomTypeName': 'Chambre 2 adultes + 1 enfant', 'quantity': 1}, {'roomTypeId': '2', 'minAdultOccupancy': 2, 'roomTypeName': 'Chambre 2 personnes', 'quantity': 1}, {'roomTypeId': '4', 'minAdultOccupancy': 2, 'roomTypeName': 'Chambre 2 adultes + 2 enfants', 'quantity': 1}, {'roomTypeId': '1', 'minAdultOccupancy': 1, 'roomTypeName': 'Chambre 1 personne', 'quantity': 2}]}, 'PAR': {'depAirportName': 'Paris', 7: {'standard': {'availableDatesAvailable': 'True', 'availableItemMetaData': ['11/2011', '12/2011', '1/2012', '2/2012', '3/2012'], '27/11/2011': {'skuId': '910608983', 'returnArrivalDate': '20111204T00:00:00', 'returnDepartureDate': '20111204T00:00:00', 'AI': {'boardTypeDescription': 'Formule tout compris', 'allocatedRooms': ['2-1'], 'totalRoomAllocationPrice': 638.0, 'rooms': [{'minAdultOccupancy': 2, 'roomTypeName': 'Chambre 2 personnes', 'totalRoomPrice': {'productPrice': 638.0}, 'roomTypeId': '2', 'roomPassengers': [{'passengerPrice': {'boardTypeSupplement': {'productPrice': 0.0}, 'discount': {'percentageDiscount': 34.0, 'discountAmount': {'productPrice': 170.0}}, 'roomTypeSupplement': {'productPrice': 0.0}, 'finalPrice': {'productPrice': 224.0}, 'holidayOptions': [{'priceDisplayStrings': [], 'baseOption': {'optionInternalCode': 'null', 'skuId': '460145316', 'price': 4.0, 'ruleTypeId': 29, 'longDescription': u'Taxe de solidarit\ufffd', 'productTypeId': 24, 'externalId': 'null', 'shortDescription': u'Taxe de solidarit\xe9 4 eur', 'id': 460145316, 'productId': '431713543'}, 'optionStyle': 'MANDATORY', 'maxQuantity': 0, 'quantity': 2}, {'priceDisplayStrings': [], 'baseOption': {'optionInternalCode': 'null', 'skuId': '829419763', 'price': 91.0, 'ruleTypeId': 29, 'longDescription': 'Taxes Obligatoires ', 'productTypeId': 24, 'externalId': 'null', 'shortDescription': 'Taxes Obligatoires 91 eur', 'id': 829419763, 'productId': '431713543'}, 'optionStyle': 'MANDATORY', 'maxQuantity': 0, 'quantity': 2}], 'priceModifierType': {'id': 4, 'description': 'Adult price'}, 'brochurePrice': {'productPrice': 394.0}, 'finalPriceWithSupplements': {'productPrice': 224.0}, 'allInclusivePrice': {'productPrice': 319.0}, 'allInclusiveBrochurePrice': {'productPrice': 489.0}}, 'person': {'passengerType': {'passengerTypeId': 1, 'passengerTypeName': 'Adult'}}, 'quantity': 2}], 'quantity': 1}], 'allInclusivePrice': 319.0}, 'departureArrivalDate': '20111127T00:00:00', 'ticketOnDeparture': ''}}}}, 'bookingCharge': {'infantPrice': 0.0, 'adultPrice': 0.0, 'childPrice': 0.0}, 'LYS': {'depAirportName': 'Lyon', 7: {'standard': {'availableDatesAvailable': 'True', 'availableItemMetaData': ['11/2011', '12/2011', '1/2012', '2/2012', '3/2012'], '27/11/2011': {'skuId': '910608910', 'returnArrivalDate': '20111204T00:00:00', 'returnDepartureDate': '20111204T00:00:00', 'AI': {'boardTypeDescription': 'Formule tout compris', 'allocatedRooms': ['2-1'], 'totalRoomAllocationPrice': 638.0, 'rooms': [{'minAdultOccupancy': 2, 'roomTypeName': 'Chambre 2 personnes', 'totalRoomPrice': {'productPrice': 638.0}, 'roomTypeId': '2', 'roomPassengers': [{'passengerPrice': {'boardTypeSupplement': {'productPrice': 0.0}, 'roomTypeSupplement': {'productPrice': 0.0}, 'finalPrice': {'productPrice': 224.0}, 'holidayOptions': [{'priceDisplayStrings': [], 'baseOption': {'optionInternalCode': 'null', 'skuId': '460145316', 'price': 4.0, 'ruleTypeId': 29, 'longDescription': u'Taxe de solidarit\ufffd', 'productTypeId': 24, 'externalId': 'null', 'shortDescription': u'Taxe de solidarit\xe9 4 eur', 'id': 460145316, 'productId': '431713543'}, 'optionStyle': 'MANDATORY', 'maxQuantity': 0, 'quantity': 2}, {'priceDisplayStrings': [], 'baseOption': {'optionInternalCode': 'null', 'skuId': '829419763', 'price': 91.0, 'ruleTypeId': 29, 'longDescription': 'Taxes Obligatoires ', 'productTypeId': 24, 'externalId': 'null', 'shortDescription': 'Taxes Obligatoires 91 eur', 'id': 829419763, 'productId': '431713543'}, 'optionStyle': 'MANDATORY', 'maxQuantity': 0, 'quantity': 2}], 'priceModifierType': {'id': 4, 'description': 'Adult price'}, 'brochurePrice': {'productPrice': 0.0}, 'finalPriceWithSupplements': {'productPrice': 224.0}, 'allInclusivePrice': {'productPrice': 319.0}, 'allInclusiveBrochurePrice': {'productPrice': 0.0}}, 'person': {'passengerType': {'passengerTypeId': 1, 'passengerTypeName': 'Adult'}}, 'quantity': 2}], 'quantity': 1}], 'allInclusivePrice': 319.0}, 'departureArrivalDate': '20111127T00:00:00', 'ticketOnDeparture': ''}}}}, 'MRS': {'depAirportName': 'Marseille', 7: {'standard': {'availableDatesAvailable': 'True', 'availableItemMetaData': ['11/2011', '12/2011', '1/2012', '2/2012', '3/2012'], '27/11/2011': {'skuId': '910608955', 'returnArrivalDate': '20111204T00:00:00', 'returnDepartureDate': '20111204T00:00:00', 'AI': {'boardTypeDescription': 'Formule tout compris', 'allocatedRooms': ['2-1'], 'totalRoomAllocationPrice': 638.0, 'rooms': [{'minAdultOccupancy': 2, 'roomTypeName': 'Chambre 2 personnes', 'totalRoomPrice': {'productPrice': 638.0}, 'roomTypeId': '2', 'roomPassengers': [{'passengerPrice': {'boardTypeSupplement': {'productPrice': 0.0}, 'roomTypeSupplement': {'productPrice': 0.0}, 'finalPrice': {'productPrice': 224.0}, 'holidayOptions': [{'priceDisplayStrings': [], 'baseOption': {'optionInternalCode': 'null', 'skuId': '460145316', 'price': 4.0, 'ruleTypeId': 29, 'longDescription': u'Taxe de solidarit\ufffd', 'productTypeId': 24, 'externalId': 'null', 'shortDescription': u'Taxe de solidarit\xe9 4 eur', 'id': 460145316, 'productId': '431713543'}, 'optionStyle': 'MANDATORY', 'maxQuantity': 0, 'quantity': 2}, {'priceDisplayStrings': [], 'baseOption': {'optionInternalCode': 'null', 'skuId': '829419763', 'price': 91.0, 'ruleTypeId': 29, 'longDescription': 'Taxes Obligatoires ', 'productTypeId': 24, 'externalId': 'null', 'shortDescription': 'Taxes Obligatoires 91 eur', 'id': 829419763, 'productId': '431713543'}, 'optionStyle': 'MANDATORY', 'maxQuantity': 0, 'quantity': 2}], 'priceModifierType': {'id': 4, 'description': 'Adult price'}, 'brochurePrice': {'productPrice': 0.0}, 'finalPriceWithSupplements': {'productPrice': 224.0}, 'allInclusivePrice': {'productPrice': 319.0}, 'allInclusiveBrochurePrice': {'productPrice': 0.0}}, 'person': {'passengerType': {'passengerTypeId': 1, 'passengerTypeName': 'Adult'}}, 'quantity': 2}], 'quantity': 1}], 'allInclusivePrice': 319.0}, 'departureArrivalDate': '20111127T00:00:00', 'ticketOnDeparture': ''}}}}, 'holidayOptions': {'baseOption': {}}, 'derivedTotalRoomAllocationPrice': '', 'derivedRooms': [{'roomTypeId': '2', 'quantity': 1}], 'roomAllocationValid': {'standard': 'False'}, 'NTE': {'depAirportName': 'Nantes', 7: {'standard': {'availableDatesAvailable': 'True', 'availableItemMetaData': ['11/2011', '12/2011', '1/2012', '2/2012', '3/2012'], '27/11/2011': {'skuId': '910608972', 'returnArrivalDate': '20111204T00:00:00', 'returnDepartureDate': '20111204T00:00:00', 'AI': {'boardTypeDescription': 'Formule tout compris', 'allocatedRooms': ['2-1'], 'totalRoomAllocationPrice': 638.0, 'rooms': [{'minAdultOccupancy': 2, 'roomTypeName': 'Chambre 2 personnes', 'totalRoomPrice': {'productPrice': 638.0}, 'roomTypeId': '2', 'roomPassengers': [{'passengerPrice': {'boardTypeSupplement': {'productPrice': 0.0}, 'roomTypeSupplement': {'productPrice': 0.0}, 'finalPrice': {'productPrice': 224.0}, 'holidayOptions': [{'priceDisplayStrings': [], 'baseOption': {'optionInternalCode': 'null', 'skuId': '460145316', 'price': 4.0, 'ruleTypeId': 29, 'longDescription': u'Taxe de solidarit\ufffd', 'productTypeId': 24, 'externalId': 'null', 'shortDescription': u'Taxe de solidarit\xe9 4 eur', 'id': 460145316, 'productId': '431713543'}, 'optionStyle': 'MANDATORY', 'maxQuantity': 0, 'quantity': 2}, {'priceDisplayStrings': [], 'baseOption': {'optionInternalCode': 'null', 'skuId': '829419763', 'price': 91.0, 'ruleTypeId': 29, 'longDescription': 'Taxes Obligatoires ', 'productTypeId': 24, 'externalId': 'null', 'shortDescription': 'Taxes Obligatoires 91 eur', 'id': 829419763, 'productId': '431713543'}, 'optionStyle': 'MANDATORY', 'maxQuantity': 0, 'quantity': 2}], 'priceModifierType': {'id': 4, 'description': 'Adult price'}, 'brochurePrice': {'productPrice': 0.0}, 'finalPriceWithSupplements': {'productPrice': 224.0}, 'allInclusivePrice': {'productPrice': 319.0}, 'allInclusiveBrochurePrice': {'productPrice': 0.0}}, 'person': {'passengerType': {'passengerTypeId': 1, 'passengerTypeName': 'Adult'}}, 'quantity': 2}], 'quantity': 1}], 'allInclusivePrice': 319.0}, 'departureArrivalDate': '20111127T00:00:00', 'ticketOnDeparture': ''}}}}, 'NCE': {'depAirportName': 'Nice', 7: {'standard': {'availableDatesAvailable': 'True', 'availableItemMetaData': ['11/2011', '12/2011', '1/2012', '2/2012', '3/2012'], '27/11/2011': {'skuId': '910101940', 'returnArrivalDate': '20111204T00:00:00', 'returnDepartureDate': '20111204T00:00:00', 'AI': {'boardTypeDescription': 'Formule tout compris', 'allocatedRooms': ['2-1'], 'totalRoomAllocationPrice': 798.0, 'rooms': [{'minAdultOccupancy': 2, 'roomTypeName': 'Chambre 2 personnes', 'totalRoomPrice': {'productPrice': 798.0}, 'roomTypeId': '2', 'roomPassengers': [{'passengerPrice': {'boardTypeSupplement': {'productPrice': 0.0}, 'roomTypeSupplement': {'productPrice': 0.0}, 'finalPrice': {'productPrice': 304.0}, 'holidayOptions': [{'priceDisplayStrings': [], 'baseOption': {'optionInternalCode': 'null', 'skuId': '460145316', 'price': 4.0, 'ruleTypeId': 29, 'longDescription': u'Taxe de solidarit\ufffd', 'productTypeId': 24, 'externalId': 'null', 'shortDescription': u'Taxe de solidarit\xe9 4 eur', 'id': 460145316, 'productId': '431713543'}, 'optionStyle': 'MANDATORY', 'maxQuantity': 0, 'quantity': 2}, {'priceDisplayStrings': [], 'baseOption': {'optionInternalCode': 'null', 'skuId': '829419763', 'price': 91.0, 'ruleTypeId': 29, 'longDescription': 'Taxes Obligatoires ', 'productTypeId': 24, 'externalId': 'null', 'shortDescription': 'Taxes Obligatoires 91 eur', 'id': 829419763, 'productId': '431713543'}, 'optionStyle': 'MANDATORY', 'maxQuantity': 0, 'quantity': 2}], 'priceModifierType': {'id': 4, 'description': 'Adult price'}, 'brochurePrice': {'productPrice': 0.0}, 'finalPriceWithSupplements': {'productPrice': 304.0}, 'allInclusivePrice': {'productPrice': 399.0}, 'allInclusiveBrochurePrice': {'productPrice': 0.0}}, 'person': {'passengerType': {'passengerTypeId': 1, 'passengerTypeName': 'Adult'}}, 'quantity': 2}], 'quantity': 1}], 'allInclusivePrice': 399.0}, 'departureArrivalDate': '20111127T00:00:00', 'ticketOnDeparture': ''}}}}}
J'ai tenté d'utiliser la fonction json_decode_nice, et la classe TidyJSON, sans succès.
Auriez-vous des pistes, ou éventuellement un script ?
Merci d'avance.




Haut











