title: Replace all characters of string to asterisks except first and last characters in PHP
body: <p>How to replace all characters of string to asterisks except first and last characters in PHP?</p>
  
  <p>For example <code>test</code> should become <code>t**t</code> and <code>profanity</code> become <code>p******y</code> and so on</p>