Define multiple needles using stripos
问题 How can i define multiple needles and still perform the same actions below. Im trying to define extra keywords such as numbers, numerals, etc... as of now i have to create a duplicate if loop with the minor keyword change. if (stripos($data, 'digits') !== false) { $arr = explode('+', $data); for ($i = 1; $i < count($arr); $i += 2) { $arr[$i] = preg_replace('/\d/', '', $arr[$i]); } $data = implode('+', $arr); } 回答1: Create a function that loops through an array? function check_matches ($data,