php把手机号中间4位变成星号

function telsubstr($tel)
{
    $telstart = substr($tel,0,3);
    $telend = substr($tel,7,4);
    return $telstart.'****'.$telend;
}

$tel = '15823458976';
echo telsubstr($tel);//显示结果为:158****8976

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: