title: replacing numbers and words
body: <p>how can i change string from this pattern 'name season 1 episode 2', to = 'name S01E02' - but if there is episode more than 10 like that 'name season 1 episode 15' only the season will change, i have try to do so:</p>
  
  <pre><code>&lt;?php
  $trans = array(
      ' season'   =&gt;      ' S',
      ' 1'        =&gt;      ' 01',
      ' 2'        =&gt;      ' 02',
      ' 3'        =&gt;      ' 03',
      ' 4'        =&gt;      ' 04',
      ' 5'        =&gt;      ' 05',
      ' 6'        =&gt;      ' 06',
      ' 7'        =&gt;      ' 07',
      ' 8'        =&gt;      ' 08',
      ' 9'        =&gt;      ' 09',
      ' episode'      =&gt;      ' E'
  );
  $q = strtr($q, $trans);
  
  
  $trans = array(
      'S '        =&gt;      'S',
      ' E '       =&gt;      'E'
  );
  $q = strtr($q, $trans);
  ?&gt;
  </code></pre>