修改身份证加密显示方式

master
zhengchanglong 5 years ago
parent cbf74bca5d
commit 8a241cceb8

@ -597,3 +597,9 @@ function encryptStr($str) {
} }
return substr_replace($str, $stars_str, 3, $length-6); return substr_replace($str, $stars_str, 3, $length-6);
} }
function encryptIdCard($str) {
$length = strlen($str);
$stars_str = "****";
return substr_replace($str, $stars_str, $length-4, 4);
}

@ -113,7 +113,7 @@
<tr> <tr>
<td class="l">身份证号</td> <td class="l">身份证号</td>
<td class="r"> <td class="r">
<input type="text" class="txt" value="{$data['idcard']|encryptStr}" readonly> <input type="text" class="txt" value="{$data['idcard']|encryptIdCard}" readonly>
<span id="idcard" class="table_click"><span class="table_click_text inner-click-text">点击修改</span></span> <span id="idcard" class="table_click"><span class="table_click_text inner-click-text">点击修改</span></span>
</td> </td>
</tr> </tr>

Loading…
Cancel
Save