Hello,
I have the following string:
$text = '
<ul>
<li>Content Content Content
<ul>
<li>Nested Content Content</li>
<li>Nested Content Conten</li>
<li>Nested Content Conten</li>
</ul>
</li>
<li>Content Content Content </li>
<li>Content Content Content</li>
</ul>';
I need help building a function that will convert the li tags to p tags, but at the same time indent the nested content with an inline styles so the output would look like the following:
Output:
<p>Content Content Content</p>
<p style="margin-left:10px">Nested Content Content</p>
<p style="margin-left:10px">Nested Content Content</p>
<p style="margin-left:10px">Nested Content Content</p>
<p>Content Content Content</p>
<p>Content Content Content</p>
Any help is greatly appreciated.