如何根据另一个数组值删除一个数组索引。例如-
Array1
(
[0] => @@code
[1] => @@label
[2] => @@name
[3] => @@age
)
Array2
(
[0] => 123jj
[1] => test
[2] => john
[3] => 45
)
Array3
(
[0] => 2 #2 is index to be unset in array1 and array2
[1] => 3 #3 is index to be unset in array1 and array2
)
我有 3 个数组,我想使用 php 根据 array3 的值取消设置 array1 和 array2 索引。我该如何使用 unset() 方法呢?
unset($array1,$array3) #this is wrong, but some thing like that
unset($array2,$array3)
使用 Out for 循环。
我应该得到
Array1
(
[0] => @@code
[1] => @@label
)
Array2
(
[0] => 123jj
[1] => test
)