title: Codeigniter and preg_replace
body: <p>I use Codeigniter to create a multilingual website and everything works fine, but when I try to use the "alternative languages helper" by Luis I've got a problem. This helper uses a regular expression to replace the current language with the new one:</p>
  
  <pre><code>$new_uri = preg_replace('/^'.$actual_lang.'/', $lang, $uri);
  </code></pre>
  
  <p>The problem is that I have a URL like this: <code>http://www.example.com/en/language/english/</code> and I want to replace only the first "<strong>en</strong>" without changing the word "<strong>english</strong>". I tried to use the limit for <code>preg_replace</code>:</p>
  
  <pre><code>$new_uri = preg_replace('/^'.$actual_lang.'/', $lang, $uri, 1);
  </code></pre>
  
  <p>but this doesn't work for me. Any ideas?</p>