1.实现代码如下
/*** 对银行卡号进行掩码处理* @param string $bankCardNo 银行卡号* @return string 掩码后的银行卡号*/function formatBankCardNo($bankCardNo){//截取银行卡号前4位$prefix = substr($bankCardNo,0,4);//截取银行卡号后4位$suffix = substr($bankCardNo,-4,4);$maskBankCardNo = $prefix." **** **** **** ".$suffix;return $maskBankCardNo;}
转载于:https://blog.51cto.com/suyanzhu/1937157