仅在文本区域字段中的数字和下一行

numbers and next line only in the textarea field

我正在尝试使用以下模式

65465465465654
6546465465465465
5646545646464
6545646456
6454646456

在文本区 请任何人帮助我 检查 preg_match 模式 对于上述输入类型

我想用下一行字符分隔手机号码。

试试这个:

$numbers = "65465465465654
6546465465465465
5646545646464
6545646456
6454646456";

preg_match_all("/([0-9]*)\n/", $numbers, $resultArray);

foreach ($resultArray as $result) {
    preg_replace("/\n/", "", $result);
}

输出:

array(4) {
  [0]=>
  string(14) "65465465465654"
  [1]=>
  string(16) "6546465465465465"
  [2]=>
  string(13) "5646545646464"
  [3]=>
  string(10) "6545646456"
}