How do I use str_replace() with multiple parameters?
<p>Basically, I want to use both <code>$city_name</code> and <code>$ref_name</code> with str_replace(), so that if either one (or both) of them are inputted by the user, both of them are replaced with their actual variable forms.</p>

<p>To give a better illustration, here's my current code;</p>

<pre><code>$headlines = array('primary_headline' =&gt; $_POST['primary_headline'], 'secondary_headline' =&gt; $_POST['secondary_headline'], 'primary_subline' =&gt; $_POST['primary_subline'], 'secondary_subtext' =&gt; $_POST['secondary_subtext']);
$city_name = "Dallas";
$ref_name = "Facebook";
if(isset($headlines)) {
  foreach($headlines as $headline) {
      echo(str_replace('$city_name', $city_name, $headline));
  }
}
</code></pre>

<p>I'd basically like <code>str_replace('$city_name', $city_name, $headline)</code> to become <code>str_replace('$city_name' AND/OR '$ref_name', $city_name AND/OR $ref_name, $headline)</code>.</p>

<p>Any answers or comments will be greatly appreciated!</p>
