implosionar eliminar php vacío

implode('-', array_filter($array));
Helpful Hawk