누군가 나를 도울 수 있는지 궁금합니다. 나는 그 결과가 있어야한다 등PHP로 간단한 배열 그룹화하기
Array
(
[World Duty Free Group] => Airport Retailer
[Duty Free Americas Inc] => Airport Retailer
[DFASS Distribution] => Airport Retailer
[Monalisa Int'l SA] => Downtown Retailer
[DUFRY America 1] => Seaport Retailer
[Neutral Duty Free Shop] => Border Retailer
[Saint Honoré] =>
[SMT PR Duty Free Inc] => Seaport Retailer
[Aer Rianta International] => Airport Retailer
[London Supply] => Downtown Retailer
[Royal Shop Duty Free] => Downtown Retailer
[Harding Brothers Retail] => Cruise/Ferry Retailers
[Motta Internacional SA] => Airport Retailer
[Tortuga Rum Co Ltd] => Downtown Retailer
[Pama Duty Free] => Seaport Retailer
[Little Switzerland] => Downtown Retailer
....
)
내가 '공항 소매', '항구 소매'에 의해 그룹에 필요한 배열을 가지고 전체를 반복하여이 작업을 수행 할 수
Array
(
[Airport Retailer] => World Duty Free Group
[Airport Retailer] => Duty Free Americas Inc
[Airport Retailer] => DFASS Distribution
...
)
중복 키가있는 배열을 가질 수 없으므로 다른 구조로 정착해야합니다. –
또는 구조체가 'Array ([Airport Retailer] => Array (면세 그룹, Duty Free American INC, DFASS Distrubution)'와 같은 각 유형의 배열을 만들 수 있습니다. – Fallen
원래 배열을 그런 식으로 구축하십시오. –