开发者

help with a php array

开发者 https://www.devze.com 2023-03-16 16:04 出处:网络
I have array that looks like this, Array ( [email_address] => Array ( [0] => sadasdasd [1] => Simosdsad

I have array that looks like this,

    Array
(
    [email_address] => Array
        (
            [0] => sadasdasd
            [1] => Simosdsad
        )

    [firstname] => Array
        (
            [0] => sadsadas
            [1] => simon
        )

    [surname] => Array
        (
            [0] => asdasdasdasdasd
            [1] => ainley
        )

    [companies_company_id] => 
    [save_user]开发者_运维百科 => Save User
)

all the keys [0] are related is there away to make these there own array?


A simple way to do this would be something like this:

$newArray = array();
foreach($array as $key => $value)  {
    $newArray[] = $value[0];
}

Is there a reason you haven't?

0

精彩评论

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