anujgarg Posted September 16, 2008 Share Posted September 16, 2008 I have a string like 478347834783398 I wanted to convert it to ***********3398 Means leaving last 4 digits intact and rest converted to '*'. How can I do it?? (With the help of str_replace, I suppose.) Link to comment https://forums.phpfreaks.com/topic/124480-solved-replace-characters/ Share on other sites More sharing options...
Mchl Posted September 16, 2008 Share Posted September 16, 2008 $masked = "************".substr($unmasked,-4;) Link to comment https://forums.phpfreaks.com/topic/124480-solved-replace-characters/#findComment-642815 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.