title: Value replacement in a file done multiple times
body: <p>I have a file with configuration data for the client-side engine written in javascript. I need  to create a configurator that will constantly alter one array of data in the config file using php. Here's the array:</p>
  
  <pre><code>var sources = new Array(
      {
      src  : somedata,
      name : "Info",
      ratio: 4/3
      },
      {
      src  : somedata2,
      name : "Тest 1",
      ratio: 16/9
      },
      {
      src  : somedata3,
      name : "Тest 2",
      ratio: 16/9
      }
      );
  </code></pre>
  
  <p>I know i can create a template where i put a placeholder in place of the array, but i don't really want to create another file as there will be many of them. Is there another way of doing it? Will appreciate any advice.</p>
  
  <p>EDIT: To elaborate, I'd have a form that sends a POST request to a php file with data (src, name, ratio), this php file in theory should alter the array in that config file (overwrite it), and the page should reload with new config.</p>