i'm having the following php code:
$html = '<p>[tag]</p>';
$test = "<a href='#'><div class='test'>button</div></a>";
$html = str_replace("[tag]", $test, $html);
when using echo htmlentities($html) i'm getting the expected result:
<p><a href='#'><div class='test'>button</div></a></p>
but when echoing the $html, firefox renders it like this:
<p>
<a href="#"></a>
</p>
<div class="test">
<p></p>
which is very strange .. any ideas what's wrong?
thanks
EDIT: i found out that it's only wrong when checking with firebug. when displaying the browser's source, it show's up as expected. nevertheless, to the browser it seems to be invalid html markup ..