我有一個僅包含數(shù)字的 16 位文本。我有一個 PHP 變量,例如: $example['example'] 我希望這個變量只有前 6 位和最后 4 位可見,其他的將被替換為星號。已解決https://i.stack.imgur.com/C5ZPF.png
1 回答
神不在的星期二
TA貢獻(xiàn)1963條經(jīng)驗(yàn) 獲得超6個贊
使用 str_replace 函數(shù)變得簡單
$example="1234567890123456";
$replace=str_replace(substr($example,6,6),str_repeat('*',6),$example);
echo "$replace";
- 1 回答
- 0 關(guān)注
- 131 瀏覽
添加回答
舉報(bào)
0/150
提交
取消
