时间:2021-07-01 10:21:17 帮助过:23人阅读
$str = "TKPC10090987TKPC10098M9YTKMR120990U9TKMR10059E56";for ($i = 0, $len = strlen($str); $i < $len; $i++){ if (substr($str, $i, 4) == 'TKPC'){ if (substr($str, $i+4, 5) <= 11069){ echo 'TKPC' . substr($str, $i+4, 8) . "\n"; } } if (substr($str, $i, 4) == 'TKMR'){ if (substr($str, $i+4, 5) <= 10999){ echo 'TKMR' . substr($str, $i+4, 8) . "\n"; } }}
TKPC10090987TKPC10098M9YTKMR10059E56