trim_array
The trim_array filter will iterate through an array and remove "unwanted" values like false, null empty array/string, strings that would be considered empty, arrays that contains "unwanted" values.
It ignores empty spaces:
It also ignores values not considered suitable for classes:
It also supports iterable and \Traversable
objects:
It also merge and handle multidimensional arrays Ex.1
Ex.2
Ex.3
Last updated
Was this helpful?