<?php $input= [ 'football GAME', 'cricket GAME', 'computer DEVICE', 'mobile DEVICE' ]; $needle = 'DEVICE'; $output = array_filter($input, fn($haystack) => str_contains($haystack, $needle)); var_export( [ 'filtered' => $output, 'found' => $output ? 'yes' : 'no' ] );
You have javascript disabled. You will not be able to edit any code.