title: Insert space into UK postcode
body: <p>With PHP 7.2, I am using the following code to insert a space into a UK postcode:</p>
  
  <pre><code>$postcode = "AB123CD";
  echo wordwrap($postcode, strlen($postcode) - 3, " ", true);
  </code></pre>
  
  <p>The code above gives the correct result... "AB12 3CD".</p>
  
  <p>However if the postcode is shorter, the code inserts 2 spaces instead of 1. So for example "A12BC" equals "A1 2B C" when it should be "A1 2BC".</p>
  
  <p>What am I doing wrong?</p>