$id=
Array
(
[0] => 1
[1] => 2
[2] => 16
)
$oid=
Array
(
[0] => 1
[1] => 1
[2] => 2
)
I want to combine it into an array as follows:
$data =
Array
(
[0] =>
[id]=1
[oid]=1
[1] =>
[id]=2
[oid]=1
[2] =>
[id]=16
[oid]=2
)
Please help me
Read more damn official documents, you don’t need to ask any master to help with these problems... (Hey, write it down casually, the $result below should be what you want...)
<?php
$id=[1,2,16];
$oid=[1,1,2];
array_work($id, function(&$v,$k)use ($oid){
});
print_r($id);