function mobileReplace($mobile,$start,$end,$str="*"){
    $countStr = abs($end-$start);
    $replaceStr = $str;
    for($i=0;$i<$countStr;$i++){
        $replaceStr.= $str;
    }
    $mobile = substr_replace($mobile, $replaceStr, $start-1, $countStr+1);
    return $mobile;;
}

  

$mobile = '13188888888'; 

echo mobileReplace($mobile,
4,7); //132****8888

php隐藏手机号指定位数

相关文章:

  • 2022-12-23
  • 2021-11-27
  • 2022-12-23
  • 2021-06-24
  • 2021-11-27
  • 2021-08-26
  • 2022-01-01
猜你喜欢
  • 2022-12-23
  • 2022-01-28
  • 2021-12-23
  • 2022-12-23
  • 2021-11-27
相关资源
相似解决方案