title: <br> vs. <BR> with str_replace in PHP
body: <p>I'm trying to do a str_replace on a  text block like below that is in variable $who:</p>
  
  <pre><code>Acme Corporation
  &lt;BR&gt;&lt;br&gt;Accounting Dept
  &lt;BR&gt;&lt;br&gt;123 Sesame St.
  &lt;BR&gt;&lt;br&gt;New York, NY 10021
  &lt;BR&gt;&lt;br&gt;(123)456-7890
  </code></pre>
  
  <p>I'm using <code>str_replace</code> below to remove the <code>&lt;br&gt;</code> and <code>&lt;BR&gt;</code> tags:</p>
  
  <pre><code>$who = str_replace("&lt;br&gt;","%0D%0A",html_entity_decode($who));
  $who = str_replace("&lt;BR&gt;","%0D%0A",html_entity_decode($who));
  </code></pre>
  
  <p>My problem is that the end result does not get rid of <BR> tags. The output looks like this:</p>
  
  <pre><code>    Acme Corporation
  &lt;BR&gt;Accounting Dept
  &lt;BR&gt;123 Sesame St.
  &lt;BR&gt;New York, NY 10021
  &lt;BR&gt;(123)456-7890
  </code></pre>
  
  <p>I didn't think capitalization would be a problem for <code>str_replace()</code>. I've tried <code>pre_replace()</code> as well and used both double and single quotes. I'm inserting this into the body of <code>mailto</code> link and html tags need to go. Any suggestions? Thank you in advance. </p>
  
  <p>EDIT: I am trying to remove all br and BR tags from the string in variable $who. I need to replace them with %0D%0A. This is because the resulting string is being inserted into the body of a mailto. Here is the full code:</p>
  
  <pre><code>//GetValues where CCDLookUps were unnecessary
  $who = CCDLookUp("data", "template", "template_name = 'poscc_header'", $db);
  $terms = $payment1-&gt;pterms-&gt;GetValue(); 
  $buyer = $users-&gt;uName-&gt;GetValue();
  $comp = $users-&gt;company-&gt;GetValue();
  $bEmail = $users-&gt;uMail-&gt;GetValue();    
  $totSold = $invoices1-&gt;total-&gt;GetValue();
  $tot = $invoices1-&gt;total-&gt;GetValue();
  $payamt = $payment1-&gt;amount-&gt;GetValue();
  $seq = $payment1-&gt;seq-&gt;GetValue();
  
  //correct Money output
  $totSold = money_format('$%i', $totSold);   
  $price = money_format('$%i', $price);   
  $tax = money_format('$%i', $tax);
  $ship = money_format('$%i', $ship); 
  $tot = money_format('$%i', $tot);   
  $payamt = money_format('$%i', $payamt);
  
  //builds header and header template     
  
  $who = str_replace("&lt;br&gt;","%0D%0A",html_entity_decode($who));
  //$who = str_replace("&lt;BR&gt;",'%0D%0A',html_entity_decode($who));
  $bodymsg = $who;
  
  
  //main body     
  $bodymsg .= "%0D%0A%0D%0AConfirmation: ".$order_id."%0D%0AOrder Date: ".$odate."%0D%0ADelivery: ".$deltype;
  $bodymsg .= "%0D%0ATerms: ".$terms."%0D%0ASeller ID: ".$sellerID."%0D%0ABuyer: ".$buyer."%0D%0A             ".$comp;
  $bodymsg .= "%0D%0A%0D%0A";
  $bodymsg .= "%0D%0ATotal Items Sold: ".$totSold."%0D%0AQty: ".$qty."%0D%0AProduct: ".$prod."%0D%0APrice: ".$price;
  $bodymsg .= "%0D%0ATax: ".$tax."%0D%0AShipping: ".$ship."%0D%0ATotal: ".$tot."%0D%0A%0D%0APayment Amount: ".$payamt;
  $bodymsg .= "%0D%0ASeq: ".$seq."%0D%0A%0D%0A%0D%0ACustomer Copy%0D%0A%0D%0ANo Refunds/No Exchanges%0D%0A";
  $bodymsg .= "Thank you";
  
  //place into message and set to link        
  $mlto = "mailto:".$bEmail."&amp;subject=Receipt%20For%20Order%23%20".$order_id."&amp;body=".$bodymsg;
  $Page-&gt;eLink-&gt;SetValue($mlto);
  </code></pre>