array_search
doesn't work, since each element of the array is an array, and an array doesn't match "*.tif". Besides, array_search
does not support wildcards like *
. An array filter would be the typical approach here:
$sider = array_filter($sider, function (array $element) {
return !preg_match('/\.tif$/i', $element[0]);
});