这里的人员是我最初使用的代码....
array_push($Parameter_IdArray, $Parameter_Id1, $Parameter_Id2, $Parameter_Id3, $OptParameter_Id);
array_push($Eqt_ParamArray, $eqt_param1, $eqt_param2, $eqt_param3, $Opt_eqt_param1);
我没有问题来推送数组值....但是现在$eqt_param1, $eqt_param2, $eqt_param3 and $Opt_eqt_param1
又在一个数组中就是这样的
Array ( [Profile_Id] => 4 [eqt_param] => Array ( [0] => 4.00 [1] => 4.00 [2] => 4.00 ) [Parameter_Id1] => 8 [min_param] => Array ( [0] => 1.00 [1] => 1.00 [2] => 1.00 ) [max_param] => Array ( [0] => 5.00 [1] => 5.00 [2] => 5.00 ) [Wtg_param] => Array ( [0] => 25.00 [1] => 25.00 [2] => 50.00 ) [Parameter_Id2] => 5 [Parameter_Id3] => 1 [Opt_eqt_param] => Array ( [0] => 0.00 ) [OptParameter_Id] => 14 [Opt_wtg] => Array ( [0] => 1.05 ) [operator] => Array ( [0] => M ) [eqt_pay] => 1,574,235 [rec_sal] => 1,485,000 [#] => -6.01 % [Emp_Id] => 490699 [Emp_Process] => Confirm New Pay )
现在我需要将数组值$eqt_param1
,$eqt_param2
,$eqt_param3
和$Opt_eqt_param1
推送到$Eqt_ParamArray
如何做到这一点?
答案 0 :(得分:0)
如果我理解正确,你现在已经在PHP中获得了一个关联数组。在那个假设下,我继续为你重新格式化了噩梦:
$myarray = array(
"Profile_Id" => 4,
"eqt_param" => array(4.00, 4.00, 4.00),
"Parameter_Id1" => 8,
"min_param" => array (1.00, 1.00, 1.00 ),
"max_param" => array (5.00, 5.00, 5.00 ),
"Wtg_param" => array (25.00, 25.00, 50.00 ),
"Parameter_Id2" => 5,
"Parameter_Id3" => 1,
"Opt_eqt_param" => array (0.00),
"OptParameter_Id" => 14,
"Opt_wtg" => array (1.05),
"operator" => array ("M"),
"eqt_pay" => array(1,574,235),
"rec_sal" => array(1,485,000),
"#" => "-6.01 %",
"Emp_Id" => 490699,
"Emp_Process" => "Confirm New Pay"
);
这个好的格式现在明确表示,您可以直接在array_push
索引上使用"eqt_param"
:
array_push($myArray["eqt_param"], $eqt_param1, $eqt_param2, $eqt_param3, $Opt_eqt_param1);
您也可能意味着要替换它,这也很容易:
$myArray['eqt_param'] = array($eqt_param1, $eqt_param2, $eqt_param3, $Opt_eqt_param1);
同样的原则适用于Javascript,你已经标记了,所以也许你的意思是。