php - can't find/replace multi line string
<p>I'm trying to find a block of text and replace it with a modified block of text and for some reason it's not working. I can execute the following line in my phpDesigner editor and it works perfectly, but when I try to execute the same command on my linux webserver it doesn't work.</p>

<p>Can someone help me out with a solution whether it's via regex or some other method?</p>

<pre><code>    $tmp_code = str_replace('&lt;!--
    {if="$membership.field_files"}
    &lt;li&gt;&lt;a href="/Members/Listings.html?id={$listing.id}&amp;action=files"&gt;&lt;span&gt;Files&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
    {else}
    &lt;li&gt;&lt;a href="/Members/Listings.html?id={$listing.id}&amp;action=files"&gt;&lt;span&gt;Files&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
    {/if}
    --&gt;','{if="$membership.field_files"}
    &lt;li&gt;&lt;a href="/Members/Listings.html?id={$listing.id}&amp;action=files"&gt;&lt;span&gt;Add/Remove Offers, Products and Files&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
    {else}
    &lt;li&gt;&lt;a href="/Members/Listings.html?id={$listing.id}&amp;action=files"&gt;&lt;span&gt;Add/Remove Offers, Products and Files&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
    {/if}',$tmp_code);
</code></pre>
