PHP - Variables and Data Types
You want to filter an array in PHP to keep only truthy values (non-empty, non-zero, etc.). Which code correctly uses boolean behavior to achieve this?
$arr = [0, 1, "", "hello", false, true, null, [], [1]];
$filtered = array_filter($arr, function($v) {
// What to put here?
});
print_r($filtered);