The array_filter() function filters the array based on the callback function; omitting the callback filters null values by default.

Grammar:

array_filter( array[, function] )


Example:

$array = [' tube ensemble project ', ' ', 'on July 6, 2021', ', ', 'filtering null values']. Print_r (array_filter($array)); Array(' Managemet item ', 'Jul 6, 2021 ',' Filter empty elements')

Use the callback function to filter the specified value

Example:

$array = [1, 2, 3, 4, 5, 6, 7, 8]; Array ($array, function($item) {return $item bb0 5; ; Array( 6, 7, 8 )