title: Most efficient way to get previous letter in the alphabet using PHP
body: <p><a href="https://stackoverflow.com/questions/2673360/most-efficient-way-to-get-next-letter-in-the-alphabet-using-php">Its working nicely</a>:</p>
  
  <pre><code>$str = 'a';
  echo ++$str; // prints 'b'
  
  $str = 'z';
  echo ++$str; // prints 'aa' 
  </code></pre>
  
  <p>Its very useful to get next column name in an excel file.</p>
  
  <p>But if I use similar code using -- operator to get the previous letter then its not working:</p>
  
  <pre><code>$str = 'b';
  echo --$str; // prints 'b' but I need 'a'
  
  $str = 'aa';
  echo --$str; // prints 'aa' but I need 'z'
  </code></pre>
  
  <p>What can be the solution to get the previous letter similarly?
  And what can be the reason as its not working?</p>