<?php $text = 'Есть два приемлих варианта +7911111111 и 8911111111. Просто иногда приходит что-то типа такого 8-911-111-11-11 что не есть гуд'; if (preg_match_all('~(?<!\d|\d-)(?:\+7|8)(?:-?\d){9,10}(?!-?\d)~', $text, $matches)) { $results = str_replace('-', '', $matches[0]); print_r($results); }
You have javascript disabled. You will not be able to edit any code.