PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $arrays = [ "a" => [ "name" => "Name 1", "age" => "99", "add" => "", ], "b" => [ "name" => "Name 2", "age" => "99", "add" => "Add2", ], "c" => [ "name" => "Name 3", "age" => "99", "add" => "Add3", ], "d" => [ "name" => "", "age" => "", "add" => "Add4", ], ]; $result = []; array_walk($arrays, function ($el, $key) use (&$result) { $empty = array_filter($el, function ($el) { return $el == ""; }); $empty_keys = array_keys($empty); if (($empty_keys)) { $result[$key] = $empty_keys; } else{ $result['res'] = true; } }); print_r($result);
Show:  
Copy Clear