Есть необходимость получения списка счетов из какого-то текста, счет - это набор цифр длиной от 20 до 30 символов. Заранее спасибо за помощь.
Пример:
Lorem Ipsum is simply 11586022020000000321391678 dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text 4551 ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining -711602202000000032154essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions 416210200 of Lorem Ipsum.
На выходе получаем: 11586022020000000321391678 и 711602202000000032154
$text = "Lorem Ipsum ... Lorem Ipsum.";
preg_match_all('#\d{20,30}#', $text, $out);
//preg_match_all('#[0-9]{20,30}#', $text, $out); - Либо так
var_dump($out[0]);
Результат:
array(2) {
[0]=>
string(26) "11586022020000000321391678"
[1]=>
string(21) "711602202000000032154"
}
Апостиль в Лос-Анджелесе без лишних нервов и бумажной волокиты
Основные этапы разработки сайта для стоматологической клиники
Продвижение своими сайтами как стратегия роста и независимости