1

大家好,这里是我最初使用的代码....

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 ) 

现在我需要 tp 推送数组值$eqt_param1$eqt_param2以及如何做到这一点$eqt_param3$Opt_eqt_param1$Eqt_ParamArray

4

1 回答 1

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,所以您可能是这个意思。

于 2012-11-29T07:04:23.913 回答