This is Actually the original Array
[radios1] => Array
(
[0] => on
)
[from] => Array
(
[0] =>
[1] => Bangalore
[2] =>
[3] =>
)
And i want to remove the empty keys of this array so i used this code to do so
`$array = array_map('array_filter', $_POST);
$array = array_filter($array);`
And the output of this is as follows
[radios1] => Array
(
[0] => on
)
[from] => Array
(
[1] => Bangalore
)
Here i have been able to remove the keys with empty values but the filtered keys should be reindexed. i have used both
array_merge array_values `
but there is no use iam getting the same output i want the output has
[radios1] => Array
(
[0] => on
)
[from] => Array
(
[0] => Bangalore
)
please help me with this how i can achieve it