当前位置: 代码迷 >> PHP >> 一个很简单的字符串切分有关问题
  详细解决方案

一个很简单的字符串切分有关问题

热度:111   发布时间:2012-04-06 12:22:24.0
一个很简单的字符串切分问题
job***@apple.com
chenghai***@qq.com

让@左边的四个字符替换为 “*”

------解决方案--------------------
PHP code


$str = 'tstkfeacbcs@ss.cds';
echo preg_replace('/.{4}@/', '****@', $str);

//tstkfea****@ss.cds 
  相关解决方案