我想获取一个数组并从中剪切一些键(不按顺序)并从中创建一个新数组。
我已经使用该array_shift()
函数进行了操作,但是到了需要跳过下一个键然后再次执行 array_shift 的地步。
我该如何从逻辑上解决这个问题?
我的阵列
Array
(
[api] => Array
(
[0] => system
[1] => assets
[2] => theme
[3] => resources
[4] => api
[5] => xml
[6] => json
[7] => jsonp
[8] => request
)
[class] => Array
(
[name] => authentication
[abbr] => auth
)
[directories] => Array
(
[application] => application
[mvc] => Array
(
[model] => model
[view] => view
[controller] => controller
)
[assets] => Array
(
[folder] => assets
[css] => css
[img] => img
[js] => js
)
[config] => config
)
[smarty] => Array
(
[security] => on
[delimiter] => Array
(
[left] => {!
[right] => !}
)
[template] => Array
(
[header] => header
[footer] => footer
[extension] => tpl
)
)
[version] => Array
(
[component] => Array
(
[0] => Array
(
[name] => CMS
[version] => 1.0
)
[1] => Array
(
[name] => TinyMCE jQuery Package
[version] => 3.5
)
[2] => Array
(
[name] => jQuery
[version] => 1.7.2
)
)
)
)
我需要用它们的键创建一个新数组:api
,,,class
version