Closed asoete closed 4 years ago
Exploding an empty string results in an array with one item. array_filter can be used to fix this:
array_filter
php > var_dump( explode(',', "") ); array(1) { [0]=> string(0) "" } php > var_dump( empty( explode(',', "") ) ); bool(false) php > var_dump( array_filter( explode(',', "") ) ); array(0) { } php > var_dump( empty( array_filter( explode(',', "") ) ) ); bool(true)
Sorry, I forgot to merge your PR. Same fix as #25.
Exploding an empty string results in an array with one item.
array_filter
can be used to fix this: