获取array_walk函数中的当前索引

时间:2016-09-07 07:23:06

标签: php array-walk

$A = ["0" => "a", "1" => "b", "2" => "c"];
$B = ["0" => "aa", "1" => "bb", "2" => "cc"]
array_walk($A,function($item) use($B){
     $temp[] = $item;
     $temp[] = $B[?];
});

怎么填?以上?如何在array_walk中获取当前索引?

1 个答案:

答案 0 :(得分:0)

如果我理解正确的话可以起作用

pairTypeValues = {}
AJS.$.each(AJS.$(".projects-list tr td:nth-child(3)"), function(index, value){
pairTypeValues[value.innerText] = getWorkflowScehmeName(value.innerText)
})