title: replacing a whole line of code inside a string from db
body: <pre><code>$find1 = "&lt;form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" target=\"_top\"&gt;";
  $replace1 = "&lt;form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" target=\"paypal\"&gt;";
  $find2 = "&lt;input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\"&gt;";
  $replace2 = "&lt;input type=\"hidden\" name=\"cmd\" value=\"_cart\"&gt;&lt;input type=\"hidden\" name=\"add\" value=\"1\"&gt;";
  $paypalcartcode = str_replace("$find1", "$replace1", $qry_listItems['paypal_code']);
  $paypalcartcode = str_replace("$find2", "$replace2", $qry_listItems['paypal_code']);
  $paypalcartcode = str_replace("https://www.paypalobjects.com/en_US/i/btn/btn_buynow_SM.gif","images/shop/icons/addtocart.png", $qry_listItems['paypal_code']);
  echo $paypalcartcode;
  </code></pre>
  
  <p>I'm trying to replace a few lines in a paypal code through my database.
  $qry string has the original code of the button since I manualy add the same code but in a Buy Now version, this one should convert it to Cart one, but the problem is that it won't even do the changes.</p>
  
  <p>I asume because str_replace is not the right code to use, or maybe I wrote it wrong.
  I checked through the page itself and through the code, it simply won't update the current code with the replaced ones.</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks</p>