fork(4) download
  1. <?php
  2. $arr = [
  3. "destino" => "op_list_gen",
  4. "id_terminal" => "",
  5. "marca" => "--",
  6. "tipo" => "--",
  7. "lyr_content" => "aawaw"
  8. ];
  9.  
  10. $newArr = array_filter($arr, function($value) {
  11. return !in_array($value, ['', '--']);
  12. });
  13.  
  14. var_dump($newArr);
Success #stdin #stdout 0.02s 23392KB
stdin
Standard input is empty
stdout
array(2) {
  ["destino"]=>
  string(11) "op_list_gen"
  ["lyr_content"]=>
  string(5) "aawaw"
}