title: php replace a value by another with a listing properly
body: <p>Hello i have a php file that generate a .dat file and i want to replace a specific value, (transform a reference to another), before generate the .dat file, with the help of a listing.</p>
  
  <p>I have try test coding to replace a value "a" to a value "b" but i don't know witch is the best way and how to implement it in my php file witch generate the .dat.</p>
  
  <pre><code>$cart_contents[$i] = $product['cart_quantity'].'x'.$product['reference'];
  </code></pre>
  
  <p>In this line i want to replace the part below by another with my listing</p>
  
  <pre><code>.$product['reference']
  </code></pre>
  
  <p>Here is the test i try to replace files</p>
  
  <pre><code>&lt;?php
  $product = array(
  "202"    =&gt; "MY REMPLACEMENT",
  "203"    =&gt; "MY ANOTHER REMPLACEMENT",
  );
  echo    $product['202'];
  
  //or 
  $product['105'] = "MY REMPLACEMENT";
  $product['106'] = "MY ANOTHER REMPLACEMENT";
  echo    $product['106'];
  ?&gt; 
  </code></pre>
  
  <p>Thank you very much.</p>