PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $filters = array("cata" => ['culo', 'moco'], "catb" => ['pura','falopa'], "catc" => [], "catd" => []); // filter the data //$data = array_filter($data, fn ($value) => $value['content'] === 'World'); // map the data //$data = array_map(fn ($value) => ['content' => $value['content']], $data); // reset indexes //$data = array_values($data); $datala = array_filter($filters, fn($e) => !empty($e)); $atala = array_sum(array_map(fn($e) => !empty($e), $filters)); print_r($datala); print_r($atala);
Show:  
Copy Clear