0

Sample PHP code:

$a = "<ul><li>Some text</li></ul>";

and I want echo that with another html code:

<div>
  <?php echo "<p>".$a."</p>"; ?>
</div>

I suppose that list will be wrapped by 'p' which will be wrapped by 'div', but instead browser parse it like this:

<div>
  <p></p>
    <ul>
      <li>Some text</li>
    </ul>
  <p></p>
</div>

I don'n know what's wrong.

0 Answers0