I have some HTML ordered/ unordered list in HTML. As I want to export it to a txt file, I need to convert it to plain text.
eg. Original HTML:
<ol><li>Item 1</li></li>Item 2</li><li>Item 3</li></ol>
I want to change it to
1. Item 1
2. Item 2
3. Item 3
I searched on StackOverflow but only found a solution of the opposite conversion. A regex that converts text lists to html in PHP
Is there any ways I can handle it? Thanks!