I would like to know how to get the length of an input and replace everything between the values start and end but leave 2 chars and both ends.
I don't want to predefine the length as I want it to work on any input with any value and still be able to read the values with PHP when form submitted.
Input: Hello world street 12
Output: He*** ***** ****** 12
Input: 185445414631
Output: 18********31
Js lib: https://github.com/igorescobar/jQuery-Mask-Plugin
My code: https://jsfiddle.net/k4y0ctho/1/