php trim function trims extra Less-than/Greater-than signs
<p>I have a question about the PHP trim function.
Consider the following:</p>

<pre><code>$x= '&lt;p&gt;blah&lt;/p&gt;';  
$x= trim(trim($x, '&lt;p&gt;'), '&lt;/p&gt;');
echo htmlentities($x) . "&lt;br /&gt;"; 

This works as expected and prints blah
</code></pre>

<p>.</p>

<pre><code>$x= '&lt;p&gt;&lt;b&gt;blah&lt;/b&gt;&lt;/p&gt;';   
$x= trim(trim($x, '&lt;p&gt;'), '&lt;/p&gt;');
echo htmlentities($x) . "&lt;br /&gt;"; 

This prints b&gt;blah&lt;/b
</code></pre>

<p>I'm not looking for other ways around this.<br />
I do wonder why the trim function shows this behavior (stripping the extra Less-than/Greater-than sign).</p>

<p>Thanks in advance.</p>
