array_filter( $array, function ($element) use ($to_remove) { return strpos($element, $to_remove) === false; } );