I have an array like :
Array
(
[0] => Array
(
[id] => 1367
[category_value] => 15
[isepisode] => 0
[title] => hello world
)
[1] => Array
(
[id] => 9892
[category_value] =>
[isepisode] => 0
[title] =>
)
[2] => Array
(
[id] => 9895
[category_value] =>
[isepisode] => 0
[title] => Bla Bla
)
)
I want to remove array those title
is empty.
Here is my code:
$res = array_map('array_filter', $data);
print_r(array_filter($res)); exit;
Above code only removing those array values are empty. But I want to remove whole array which title is null. My output should be:
Array
(
[0] => Array
(
[id] => 1367
[category_value] => 15
[isepisode] => 0
[title] => hello world
)
[2] => Array
(
[id] => 9895
[category_value] =>
[isepisode] => 0
[title] => Bla Bla
)
)
Note: I have thousands of array. If put foreach this will take time to execute. Is there any easiest way to do that?