开发者

Matching array keys

开发者 https://www.devze.com 2023-01-07 10:47 出处:网络
I have this array, Array ( [campaign_title] => adasdasdasddsad [campaign_keyword] => asdsadasdasdasdasd [introduction] => asdasdasdasdasdasdsa

I have this array,

Array
(
    [campaign_title] => adasdasdasddsad
    [campaign_keyword] => asdsadasdasdasdasd
    [introduction] => asdasdasdasdasdasdsa
    [campaign_headline] => Array
        (
            [0] => asdasdasdasdasdasdad
        )

    [article] => Array
        (
            [0] => asdasdasdasdasdasdasdasdsadas
        )
    [save_multiple] => Save
)

Basically I need away to send the the campaign_headline and article array to a DB so that each headline and article are saved to the same row, th开发者_StackOverflowen the next headline and article are saved to the same row etc


foreach ($x['campaign_headline'] as $key => $headline)
{
    store_into_db($headline, $x['article'][$key]);
}

function store_into_db($headline, $article)
{
    /* there you must store article into DB, i can write this code but i must more infomraiton about, db server type and tables password etc. */
}
0

精彩评论

暂无评论...
验证码 换一张
取 消