array_filter()
with null
as the callback to remove empty elements from an arrayarray_filter()
with null
as the callback to remove empty elements from an arrayWhen you need to remove empty elements from an array, you can use array_filter()
with null
as the callback function. This will filter out any elements that evaluate to false
in