Overview of what's gonna happen, For the sake of the example, I provided Email Address, First Name, and Last Name. And each of columns has a check box if the user wants to include it on import or not.
In this example, Last Name
wasn't supposed to be included. So when I pass submit, the data of checkbox is being output like this.
Array
(
[0] => Email Address
[1] => First Name
)
Which is correct, then what I want to happen is, to remove the Last Name
on the original data (multidimensional array), Unfortunately, array_diff() doesn't work, or else I may have did something wrong.
I have these 2 arrays
$mapping_import_value = $_SESSION['mapping_import_value'];
$arr_import_column = $_POST['import_column'];
Mapping Import Value: A multi dimensional array
Array
(
[Email Address] => Array
(
[0] => email11@gmail.com
[1] => email12@gmail.com
[2] => email13@gmail.com
)
[First Name] => Array
(
[0] => Guy 11
[1] => Guy 12
[2] => Guy 13
)
[Last Name] => Array
(
[0] => Stand 11
[1] => Stand 12
[2] => Stand 13
)
)
Then
Arr Import Column: A single array
Array
(
[0] => Email Address
[1] => First Name
)
So it will be like, 2 arrays will match, if something is not matched (Last Name) it will be removed including it's child. So any help would be nice. :D