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