How can I remove one array index on the basis of another array value. For example-
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
)
I have 3 arrays , I want to unset array1 and array2 index on the basis of value of array3 using php.How can I use unset() Method for this?
unset($array1,$array3) #this is wrong, but some thing like that
unset($array2,$array3)
With Out for loop.
I should get
Array1
(
[0] => @@code
[1] => @@label
)
Array2
(
[0] => 123jj
[1] => test
)
You asked similar question and removed it after getting the answer :
unset array indexs from value of another array?