1

这是我的代码,

foreach ( $tick_data as $tick_index => $tick_entries ) {

            foreach ( $base_data as $baseproject ) {

                if ( $baseproject['name'] == $tick_entries['project_name'] )
                    $projects_id_tickcamp[$baseproject['id']]['tick_id'] = $tick_entries['project_id'];
            }
        }

这给出了多维数组:

Array
    (
        [1181543] => Array
            (
                [tick_id] => 445196
            )

        [1287834] => Array
            (
                [tick_id] => 437574
            )
    )

在这段代码中,在应用发布消息功能后,我得到了不同的名为 message id 的数组,创建了一个子数组:

foreach ( $projects_id_tickcamp as $basecamp_project_id => $tick_id ) {

        $post_message_id = $this->post_message( $basecamp_project_id );
        $projects_id_tickcamp[$basecamp_project_id]['message_id'] = $post_message_id;
}

此代码的输出:

Array
(
    [1181543] => Array
        (
            [tick_id] => 445196
            [message_id] => 5208908
        )

    [1287834] => Array
        (
            [tick_id] => 437574
            [message_id] => 5208912
        )
)

问题是,如果我将来获得更多 $baseproject['id'] ,那么我必须在该 $baseproject['id'] 上发布消息,但在整个阵列上除外。请看一下这个问题,任何建议都会感谢我。

4

0 回答 0