在遍历这些数组时遇到了一些麻烦,我在每个数组 fstransid、前缀、nr 和日期中都有 4 个相同的属性,其余的“名称”、“fsa_code”、“fsa_name”、“debits_acc”和“credits_acc”我想要在以下 5 个数组中提取这些 1->5
解决这个问题的最佳方法是什么?
array(18) {
[0]=>
array(9) {
["fstransid"]=>
string(4) "4019"
["prefix"]=>
string(3) "PSF"
["nr"]=>
string(3) "854"
["date"]=>
string(10) "2012-06-05"
["name"]=>
string(33) "MY NAME"
["fsa_code"]=>
string(4) "1681"
["fsa_name"]=>
string(17) "asdfasdfasdf"
["debits_acc"]=>
string(6) "546.94"
["credits_acc"]=>
string(4) "0.00"
}
[1]=>
array(9) {
["fstransid"]=>
string(4) "4019"
["prefix"]=>
string(3) "PSF"
["nr"]=>
string(3) "854"
["date"]=>
string(10) "2012-06-05"
["name"]=>
string(33) "MY NAME"
["fsa_code"]=>
string(4) "2621"
["fsa_name"]=>
string(8) "asafafasdfsas"
["debits_acc"]=>
string(4) "0.00"
["credits_acc"]=>
string(5) "60.75"
}
[2]=>
array(9) {
["fstransid"]=>
string(4) "4019"
["prefix"]=>
string(3) "PSF"
["nr"]=>
string(3) "854"
["date"]=>
string(10) "2012-06-05"
["name"]=>
string(33) "MY NAME"
["fsa_code"]=>
string(4) "3540"
["fsa_name"]=>
string(5) "sfdsdfsfssssssssssss"
["debits_acc"]=>
string(4) "0.00"
["credits_acc"]=>
string(5) "60.71"
}
[3]=>
array(9) {
["fstransid"]=>
string(4) "4019"
["prefix"]=>
string(3) "PSF"
["nr"]=>
string(3) "854"
["date"]=>
string(10) "2012-06-05"
["name"]=>
string(33) "MY NAME"
["fsa_code"]=>
string(4) "6060"
["fsa_name"]=>
string(27) "kostnader"
["debits_acc"]=>
string(4) "9.00"
["credits_acc"]=>
string(4) "0.00"
}
[4]=>
array(9) {
["fstransid"]=>
string(4) "4019"
["prefix"]=>
string(3) "PSF"
["nr"]=>
string(3) "854"
["date"]=>
string(10) "2012-06-05"
["name"]=>
string(33) "MY NAME"
["fsa_code"]=>
string(4) "6064"
["fsa_name"]=>
string(12) "asdfasdfasdsdssdssds"
["debits_acc"]=>
string(5) "11.06"
["credits_acc"]=>
string(4) "0.00"
}
[5]=>
array(9) {
["fstransid"]=>
string(4) "4019"
["prefix"]=>
string(3) "PSF"
["nr"]=>
string(3) "854"
["date"]=>
string(10) "2012-06-05"
["name"]=>
string(33) "MY NAME"
["fsa_code"]=>
string(4) "3002"
["fsa_name"]=>
string(35) "assssdsdsdsd"
["debits_acc"]=>
string(4) "0.00"
["credits_acc"]=>
string(6) "445.54"
}