The four digits in the middle of the mobile phone number processed by php are asterisks *****, and the mobile phone number asterisks
In the scenario of displaying the user list, the mobile phone number must be processed when the mobile phone number is displayed. Generally, the four digits in the middle must be replaced by an asterisk ****, I am using php to replace the four digits in the middle of the mobile phone number ***.
The Code is as follows:
$ All_lottery_logs = ********; // This statement is a winning record. // traverse and process the mobile phone number foreach ($ all_lottery_logs as $ k => $ v) {$ xing = substr ($ v ['tel'], 3,4 ); // obtain the four digits in the middle of the mobile phone number $ all_lottery_logs [$ k] ['tel'] = str_replace ($ xing, '***', $ v ['tel']); // Replace}
In general, the code is relatively simple and the efficiency is not high, but because the project data volume is small, so we should handle it first. We welcome to propose a better method.