title: Displaying the 0 in front of a number
body: <p>I'm generating auto incremental code through a PHP script. The sequence goes like this, <strong>L001</strong>, <strong>L002</strong>....<strong>L039</strong>, <strong>L040</strong>. Below is the PHP code I have written. The comments show the output of each statement.</p>
  
  <pre><code>&lt;?php
  
  require_once("db_handler.php");
  
  $conn = iniCon();
  $db = selectDB($conn);
  
  $query = "SELECT LID FROM locations ORDER BY LID DESC LIMIT 1";
  $result = mysql_query($query, $conn);
  $row = mysql_fetch_array($result);
  $last_id = $row['LID'];   //L040
  
  $id_letter = substr($last_id, 0, 1);  //L
  $id_num = substr($last_id, 1) + 1;   //040 + 1
  $new_id = $id_letter . $id_num;
  
  mysql_close($conn);
  
  ?&gt;
  </code></pre>
  
  <p>I'm displaying the <code>$new_id</code> in a HTML textbox. though everything works fine up to this point,  the new generated code shows as <strong>L41</strong>, cutting off the leading zero. </p>
  
  <p>How can I stop this from happening? I need to have that zero in the front.</p>
  
  <p>Thank you.</p>