2024年09月10日 建站教程
php开发中,如何利用正则表达式替换冒号后面几位数字?下面web建站小编给大家简单介绍一下!
具体语法如下:
<?php
$input = '13011122233';
$output = preg_replace('/(?<=:\b)[0-9]{11}/', '***********', $input);
echo $output; // 输出:130*********
?>
本文链接:http://so.lmcjl.com/news/12687/