How can I make all html tags close in the same line with php : <p>For example, if I have</p>

<pre><code>&lt;b&gt;Line 1
Line 2&lt;/b&gt;
</code></pre>

<p>I want to make it become </p>

<pre><code>&lt;b&gt;Line 1&lt;/b&gt;
&lt;b&gt;Line 2&lt;/b&gt;
</code></pre>

<p>thanks.</p>
