我想创建一个多维数组。可以说我想把这个变成两个:
{
"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"
}
]
}
假设我想将前五个项目放入一个名为“dogs”的数组中,然后我想将其他五个项目放入一个名为“noDogs”的数组中。我该怎么做?