help with a php array
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?
精彩评论