確定這裏是我想要做的。我有一個數組。我想要做的是從第一個索引值的另一個數組。就拿下面我想創建和數組從這個:使用另一個數組的索引值創建一個數組
Array (
[identifier] => ID
[label] => HouseNum
[items] => Array (
[0] => Array (
[ID] => 1
[HouseNum] => 17
[AptNum] =>
[Street] => birch glen dr
[City] => Clifton Park
[State] => NY [Zip5] =>
[EID] => E083223
[RequestDate] => 02/05/09
[Status] => In-Qeue
[DateCompleted] =>
[CompletedBy] =>
[ContactName] => Suzy Q
[ContactNumber] => 555-867-5309
[ContactTime] => 9-9)
)
);
這將最終看起來像這樣:
Array(
[0] => [ID]
[1] => [HouseNum]
[2] => [AptNum]
[3] => [Street]
[4] => [City]
[5] => [State]
[6] => [Zip5]
[7] => [EID]
[8] => [RequestDate]
[9] => [Status]
[10] => [DateCompleted]
[11] => [CompletedBy]
[12] => [ContactName]
[13] => [ContactNumber]
[14] => [ContactTime]
);
就如何實現這一目標有什麼想法?我主要需要知道如何獲得索引值。
+1使用本機的功能。但是有一個小錯誤:`items`只是給定變量的一個元素,而不是變量本身。 – Gumbo 2009-05-06 16:16:18