<?php
'М903СЕ197',
'А777МР97',
'Е555КХ99',
'К001РА95',
'Ошибка',
'О1234ОО799'
);
'А','В','Е','К','М','Н','О','Р','С','Т','У','Х'
);
'A','B','E','K','M','H','O','P','C','T','Y','X'
);
foreach ($numbers as $number) {
echo 'Входной номер: ' . $number . ' ';
$pattern = '/([ABEKMHOPCTYX])([0-9]{3})([ABEKMHOPCTYX]{2})([17]{0,1}[0-9]{2})/i';
echo 'Выходной массив: ';
}
PD9waHAKJG51bWJlcnMgPSBhcnJheSgKICAn0Jw5MDPQodCVMTk3JywKICAn0JA3NzfQnNCgOTcnLAogICfQlTU1NdCa0KU5OScsCiAgJ9CaMDAx0KDQkDk1JywKICAn0J7RiNC40LHQutCwJywKICAn0J4xMjM00J7Qnjc5OScKICApOwokY3lyaWwgPSBhcnJheSgKICAn0JAnLCfQkicsJ9CVJywn0JonLCfQnCcsJ9CdJywn0J4nLCfQoCcsJ9ChJywn0KInLCfQoycsJ9ClJwogICk7CiRsYXRpbiA9IGFycmF5KAogICdBJywnQicsJ0UnLCdLJywnTScsJ0gnLCdPJywnUCcsJ0MnLCdUJywnWScsJ1gnCiAgKTsKCmZvcmVhY2ggKCRudW1iZXJzIGFzICRudW1iZXIpIHsKICBlY2hvICfQktGF0L7QtNC90L7QuSDQvdC+0LzQtdGAOiAnIC4gJG51bWJlciAuICcgJzsKICAkbnVtYmVyID0gc3RyX3JlcGxhY2UoJGN5cmlsLCAkbGF0aW4sICRudW1iZXIpOwogICRwYXR0ZXJuID0gJy8oW0FCRUtNSE9QQ1RZWF0pKFswLTldezN9KShbQUJFS01IT1BDVFlYXXsyfSkoWzE3XXswLDF9WzAtOV17Mn0pL2knOwogIHByZWdfbWF0Y2goJHBhdHRlcm4sICRudW1iZXIsICRyZXN1bHQpOwogICRyZXN1bHQgPSBzdHJfcmVwbGFjZSgkbGF0aW4sICRjeXJpbCwgJHJlc3VsdCk7CiAgZWNobyAn0JLRi9GF0L7QtNC90L7QuSDQvNCw0YHRgdC40LI6ICc7CiAgcHJpbnRfcigkcmVzdWx0KTsKfQo=