Hello, thank you in advance for your help.
I have been doing some xml to array scripts, the array is fine, but there are results that are alike and need them grouped. E.g.
Hotels
ID->1
Name->Hilton Hotel
Checkin->jan 15
Checkout->Jan 20
ID->9
Name->Westin Hotel
Checkin->feb 15
Checkout->feb 20
ID->3
Name->Carlton Hotel
Checkin->jan 1
Checkout->Jan 10
ID->1
Name->Hilton Hotel
Checkin->apr 18
Checkout->apr 25
- ID->1
- Name->Hilton Hotel
- Checkin->jan 15
- Checkout->Jan 20
- ID->9
- Name->Westin Hotel
- Checkin->feb 15
- Checkout->feb 20
- ID->3
- Name->Carlton Hotel
- Checkin->jan 1
- Checkout->Jan 10
- ID->1
- Name->Hilton Hotel
- Checkin->apr 18
- Checkout->apr 25
Notice Hilton hotel appears twise but with different dates, instead of listing the hotel twise I want to list only one Hilton and within the two available dates.
So I get something like this
hotel[0]
ID->1
Name->Hilton Hotel
Dates[0]
Checkin->jan 15
Checkout->Jan 20
Dates[1]
Checkin->apr 18
Checkout->apr 25
hotel[1]
ID->9
Name->Westin Hotel
Dates[0] ->
Checkin->feb 15
Checkout->feb 20
hotel[2]
ID->3
Name->Carlton Hotel
Dates[0]
Checkin->jan 1
Checkout->Jan 10
- hotel[0]
- ID->1
- Name->Hilton Hotel
- Dates[0]
- Checkin->jan 15
- Checkout->Jan 20
- Dates[1]
- Checkin->apr 18
- Checkout->apr 25
- hotel[1]
- ID->9
- Name->Westin Hotel
- Dates[0] ->
- Checkin->feb 15
- Checkout->feb 20
- hotel[2]
- ID->3
- Name->Carlton Hotel
- Dates[0]
- Checkin->jan 1
- Checkout->Jan 10
Any help will be highly appreciated.
Regards