Rumah >pembangunan bahagian belakang >tutorial php > 计作数值是否是包含AA AABB AAA AAAA AAABBB AAAABBBB AAABBBCCC
计算数值是否是包含AA AABB AAA AAAA AAABBB AAAABBBB AAABBBCCC
<?php <br /> //$a是一个10位的随机值式 <br /> $int_a=2334357984; <br /> echo 'AA'; <br /> echo '33'; //还想输出33 <br /> <br /> $int_a=2332257984; <br /> echo 'AABB'; <br /> echo '3322'; //还想输出3322 <br /> <br /> $int_a=2333357984; <br /> echo 'AAAA'; <br /> echo '3333'; //还想输出3333 <br /> <br /> $int_a=2333555984; <br /> echo 'AAABBB'; <br /> echo '333555'; //还想输出333555 <br /> <br /> $int_a=2333888666; <br /> echo 'AAABBBCCC'; <br /> echo '333888666'; //还想输出333888666 <br /> ....................
$int_a=2332257984; <br /> preg_match('/(.)\\1(.)\\2/', $int_a, $r);<br /> echo $r[0];<br />3322