How to remove a repeating sequence from a string - php
<p>I have a function written by someone else which returns the address of a customer. This function isn't as simple as you would have thought it might need to be. For a good reason it has been written so that the return variable goes through:</p>

<pre><code>eval("\$address_out = \"$fmt\";");
</code></pre>

<p>first. And despite a quick look in the manual just what it does it a mystery to me. So the problem is the address is returned like these two examples (note on has 3 repeating <code>&lt;br/&gt;</code>s and the other 4)</p>

<pre><code>ginger rogers&lt;br /&gt; hollywood&lt;br /&gt; California&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; United states

ginger rogers&lt;br /&gt; hollywood&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; United states
</code></pre>

<p>I thought it would be quicker to just strip the repeating <code>&lt;br/&gt;</code>s out but I'm confused because there can be a different amount of them and they are seperated by spaces.</p>

<p>Anyone any ideas?</p>

<p>EDIT: I should have said, I want to keep one of the <br/> between each bit of the address, it's where there are multipul <br/> I want to get rid of all but one</p>
