1
我有一個多維PHP數組看起來像這樣在JSON:搜索在多維數組複製PHP
array = [{
"id":"1",
"key":"Ferrari",
"type":"car"},
{
"id":"1",
"key":"Red",
"type":"color"},
{
"id":"73",
"key":"Yellow",
"type":"color"
}]
因爲它實際上是一個搜索結果,我想,動態地結合其中的id是結果相同。換句話說,新的數組應該是這樣的:
array = [{
"id":"1",
"key":"Red Ferrari",
"type":"keyword"},
{
"id":"73",
"key":"Yellow",
"type":"color"
}]
我一直在尋找了大量的PHP函數,但他們有一個有限的功能,在多維數組。任何建議都讚賞:)
許多方面
安德烈亞斯
一個匹配總是會導致'type:keyword'?名字是如何組合的?你知道哪裏確定它是*紅色法拉利*而不是*法拉利紅色*? – insertusernamehere 2013-02-10 13:36:34