title: Replace only the first character of a string with str_replace?
body: <p>I'm trying to replace only the first character of a string, but it isn't working, it replaces all the "0" on the string, here's my code:</p>
  
  <pre><code>$mes2 = str_replace('0', '', $mes[0]);
  </code></pre>
  
  <p>I want to replace the first character only if its a 0, example:</p>
  
  <blockquote>
    <p>07 becomes 7</p>
  </blockquote>
  
  <p>I don't want to replace all the time, example:</p>
  
  <blockquote>
    <p>11 becomes 1, i don't want it.</p>
  </blockquote>
  
  <p>I also tried this way, but it didn't work the way i want, because it's replacing also the second character if it's 0, like 10 becomes 1.</p>
  
  <pre><code>$mes2 = preg_replace('/0/', '', $mes, 1);
  </code></pre>