username(
[0] => 'andrew';
[1] => 'teddy';
[2] => 'bear';
)
email(
[0] => 'andrew@andrew.com';
[1] => 'teddy@teddy.com';
[2] => 'bear@bear.com';
)
I got 2 Array coming in from post. I am processing this with PHP.
I would like to combine the array so it looks like this.
So I can use a loop on the array to insert a query on a database.
[1] => Array (
[0] => 'andrew';
[1] => 'andrew@andrew.com';
)
[2] => Array (
[0] => 'teddy';
[1] => 'teddy@teddy.com';
)
[3] => Array (
[0] => 'bear';
[1] => 'bear@bear.com';
)
Take a look at array_combine()
If that doesn’t solve your problem, you can always just go with a simple loop: