title: PHP preg_replace in a file?
body: <p>I want to replace some characters with preg_replace in a external file.</p>
  
  <p>I'm trying the code below:</p>
  
  <pre><code>$arch = 'myfile.txt';
  $filecontent = file_get_contents($arch);
  
  $patrones = array();
  $patrones[0] = '/á/';
  $patrones[1] = '/à/';
  $patrones[2] = '/ä/';
  $patrones[3] = '/â/';
  
  $sustituciones = array();
  $sustituciones[0] = 'a';
  $sustituciones[1] = 'a';
  $sustituciones[2] = 'a';
  $sustituciones[3] = 'a';
  
  preg_replace($patrones, $sustituciones, $filecontent);
  </code></pre>
  
  <p>But it's not working. How could I do that?</p>
  
  <p>Is there any better way to do that?</p>
  
  <p>Thanks a lot.</p>