Hello friends, I have this doubt
as <div>
tags by <p>
in php
but ...
I have <div>
tags that have classes and / or styles that I want to keep with their respective% </div>
Try this but delete the </div>
that I want to keep
str_replace('<div>', '<p>', $body);
str_replace('</div>', '</p>', $body);
this is my code
<div>
Lorem ipsum dolor sit amet
</div>
<div>
Lorem ipsum dolor sit amet
</div>
<div>
<div class="media_embed">
<div style="xxx">
<div style="xxx">
<div style="xxx"></div>
</div>
</div>
</div>
</div>
<div>
Lorem ipsum dolor sit amet
</div>
I would like it to be like this:
<p>
Lorem ipsum dolor sit amet
</p>
<p>
Lorem ipsum dolor sit amet
</p>
<p>
<div class="media_embed">
<div style="xxx">
<div style="xxx">
<div style="xxx"></div>
</div>
</div>
</div>
</p>
<p>
Lorem ipsum dolor sit amet
</p>
I just want to keep the divs
that have class or style with its% </div>
Could you help me please