title: PHP - str_replace not working with URL variable string
body: <p>I am building URL variables into another variable named '$url' below:</p>
  
  <pre><code>$url = "page2.php?";
  $url .= "&amp;Keyword=$keyword";
  
  $shopByStore = $_GET["store"];
  if (!empty($shopByStore)) {
  
  $url .= "&amp;store=$shopByStore";
  
  }
  // plus many more variables built into the URL variable based on user input.
  </code></pre>
  
  <p>Under certain conditions, I will need to remove portions of the $url variable string. The str_replace method is not removing the portion of the string in the $url variable placed in the href tags. The value for '&amp;store' is appearing in the source code and in the actual link in the browser.</p>
  
  <pre><code>if ($foo == "certain_condition) {
  str_replace("&amp;store=$shopByStore", "", $url);
  ?&gt;
  &lt;a href="&lt;?php echo $url; ?&gt;"&gt;Clear&lt;/a&gt;&lt;br&gt;
  &lt;?php
  }
  </code></pre>
  
  <p>Any advice is greatly appreciated!!!</p>