经过几次尝试,我无法找到一种有效的方法来做到这一点。我目前有一个函数正在运行preg_match_all
并返回三个这样的数组;
array(3) {
["name"] =>
array(3) {
0 => "Google Chrome 22.0.1229.94",
1 => "LastPass for Chrome 2.0.7",
2 => "Chromatic 0.2.3"
}
["link"] =>
array(3) {
0 => "/app/mac/32956/google-chrome",
1 => "/app/mac/42578/lastpass-for-chrome",
2 => "/app/mac/32856/chromatic"
}
["description"] =>
array(3) {
0 => " - Modern and fast Web browser."
1 => " - Online password manager and form filler for Chrome."
2 => " - Easily install and updated Chromium."
}
}
我需要能够像这样组合三个数组;
array(3) {
array(3) {
["name"] = "Google Chrome 22.0.1229.94",
["link"] = "/app/mac/32956/google-chrome",
["description"] = " - Modern and fast Web browser."
}
array(3) {
["name"] = "LastPass for Chrome 2.0.7",
["link"] = "/app/mac/42578/lastpass-for-chrome",
["description"] = " - Online password manager and form filler for Chrome."
}
array(3) {
["name"] = "Chromatic 0.2.3",
["link"] = "/app/mac/32856/chromatic",
["description"] = " - Easily install and updated Chromium."
}
}
我一直在尝试count( $values )
并做一个 for 循环来制作新数组。