You can use array_filter():
If no callback is supplied, all entries of input equal to
FALSE(see converting to boolean) will be removed.
implode('-', array_filter($array));
Obviously this will not work if you have 0 (or any other value that evaluates to false) in your array and you want to keep it. But then you can provide your own callback function.