3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = ["abc", "def", "ghi"]; $excludeKeyword_arr = ["ab", "de"]; foreach ($array as $index => $haystack) { foreach ($excludeKeyword_arr as $needle) { if (strpos($haystack, $needle) !== false) { unset($array[$index]); break; } } } var_export(array_values($array));

preferences:
24.5 ms | 406 KiB | 5 Q