I I have tried to remove null or empty values from array listing but not working.
Following is my array output..
Array
(
[0] => Array
(
[post_id] => 1173
[post_content] => Rocking Tips
[comment_id] => 1173
[comment_content] => Nice Post
[comment_date] =>
[user_id] =>
[username] =>
[email] =>
[first_name] =>
[last_name] =>
)
[1] => Array
(
[post_id] =>
[post_content] =>
[comment_id] =>
[comment_content] =>
[comment_date] =>
[user_id] =>
[username] =>
[email] =>
[first_name] =>
[last_name] =>
)
[2] => Array
(
[post_id] => 1173
[post_content] => Rocking Tips
[comment_id] => 1176
[comment_content] => WOnder
[comment_date] => 2020-05-21 21:10:04
[user_id] => 168
[username] => kkkk20
[email] => [email protected]
[first_name] => sam
[last_name] => test
[reply] => Array
(
[comment_id] => 1177
[comment_details] => Thank YOu
[comment_date] => 2020-05-21 21:12:14
[user_id] => 179
[username] => test20201
[email] => [email protected]
[replay] =>
)
)
)
I have tried to remove empty array value using array_filter() but still empty value is showing when i print my array.
I also tried like,
$filtered = array_filter($myArray, function($var){return !is_null($var);} );
echo "<pre>List Data";print_r($filtered);
I want to remove 1 index array from list