问题替换PHP数组中的变量

时间:2015-08-05 00:10:21

标签: php arrays

我在替换数组中的值时遇到了麻烦。我显示状态已更改为“非活动”,但更改似乎并不反映我要更改的数组。任何帮助,将不胜感激。该变量在同一页面中声明,我不确定是否存在范围问题,但我很确定不是这种情况。

这就是我所拥有的:

foreach ($ARG_WP_Payflow_Recurring_Billing_Profiles as $key => $value){
if($value['PROFILEID'] == $_POST['DeactivateProfile']){
    echo 'DING FRIES ARE DONE!<br>'.$value['STATUS'].' '.$value['PROFILEID'];
    $value['STATUS'] = "INACTIVE";
    echo '<br><br>'.$value['STATUS'];
    echo '<pre>';
    print_r ($ARG_WP_Payflow_Recurring_Billing_Profiles);
    echo '</pre>';
}

这是我在传递'RT0000000805'时得到的结果

DING FRIES ARE DONE!
ACTIVE RT0000000805

INACTIVE
Array
(
    [0] => Array
        (
            [FIRSTNAME] => John
            [LASTNAME] => Doe
            [ZIP] => 95101
            [ACCT] => 5100
            [EXPDATE] => 1215
            [STATUS] => ACTIVE
            [PROFILEID] => RT0000000805
        )

    [1] => Array
        (
            [FIRSTNAME] => John
            [LASTNAME] => Doe
            [ZIP] => 95101
            [ACCT] => 5100
            [EXPDATE] => 1215
            [STATUS] => ACTIVE
            [PROFILEID] => RT0000000806
        )

    [2] => Array
        (
            [FIRSTNAME] => John
            [LASTNAME] => Doe
            [ZIP] => 95101
            [ACCT] => 5100
            [EXPDATE] => 1215
            [STATUS] => ACTIVE
            [PROFILEID] => RT0000000807
        )

)

0 个答案:

没有答案