0
我想創建一個多維數組。比方說,我希望把這個分成兩個:適用於appcelerator的多維JSON示例
{
"fighters": [
{
"name": "Muhammad Ali",
"nickname": "The Greatest",
"image": "http://upload.wikimedia.org/wikipedia/commons/1/13/Clyde_The_Bulldog.jpg"
},
{
"name": "Chuck Liddell",
"nickname": "The Iceman",
"image": "http://images.pictureshunt.com/pics/s/saint_bernard-12924.jpg"
},
{
"name": "Rocky Marciano",
"nickname": "The Brockton Blockbuster",
"image": "http://www.goodhousekeeping.com/cm/goodhousekeeping/images/IO/alaskan-malamute-fb.jpg"
},
{
"name": "Randy Couture",
"nickname": "The Natural",
"image": "http://slog.thestranger.com/files/2006/09/bigdog.jpg"
},
{
"name": "Fedor Emelianenko",
"nickname": "The Last Emperor",
"image": "http://affordablehousinginstitute.org/blogs/us/wp-content/uploads/small_dog_on_big_dog.jpg"
},
{
"name": "Jon Jones",
"nickname": "Bones"
},
{
"name": "George Foreman",
"nickname": "Big George"
},
{
"name": "Wanderlei Silva",
"nickname": "The Axe Murderer"
},
{
"name": "Gearges St. Pierre",
"nickname": "Rush"
},
{
"name": "Manny Pacquiao",
"nickname": "Pac-Man"
}
]
}
說我想把前五個項目進入所謂的「狗」數組,然後我希望把其他五個項目進入所謂的「noDogs數組」。我將如何做到這一點?