title: How to format a UK bank sort code?
body: <p>As part of a form I collect a users bank details which includes their sort code. The sort code is stored in the database as six numbers, for example <code>771731</code>.</p>
  
  <p>I'd prefer to store the sort code in this format (without the hyphens) as it makes it easier for me to work with in other areas of the site. I want to output the sort code in one area of the site but in the format <code>77-17-31</code> using PHP.</p>
  
  <p>I have searched Google for a solution but surprisingly found very little.</p>