Да, это жизнеспособно.Вы можете сделать это с помощью замены строки на пробел и - , например:
$input = '3571157, 357-11-57, 81749 91741 9080, 81749 91741 9080, 81749 91741 9080 ,357 11 57, 81749 91741 9080';
$split_inputs = preg_split('/,/s', $input);
$output = '';
foreach ($split_inputs as $key => $value) {
$match = preg_match('/^[0-9 \-]{7,9}$/s', trim($value));
if (!$match) {continue;}
$output .= preg_replace('/-|\s/s', '', $value);
if (sizeof($split_inputs) - 1 - $match != (int) $key) {
$output .= ", ";
}
}
var_dump($output);
Выход
string(25) "3571157, 3571157, 3571157"
Вы можете использовать это RegEx и соответствует вашему вводу первым.
^[0-9\s\-]{7,9}$
