I want to convert the following text to list items
* Item 1 * Item 2 - item 1 - item 2
to
<ul> <li>Item 1</li> <li>Item 2</li> </ul>
I made the following regex that is not enough for this
$text = preg_replace('#(*\s[*.]\s*)#','<li>$0</li>', $text);
but that will not work. I do not know how to do RE.
I ask myself a clearer question.
The text may or may not contain markers, and I cannot skip the loop through the file, as suggested.
Here are some examples.
* HTML *SEO * Javascript * PHP - HTML - SEO -Javascript -PHP -HTML - SEO -Javascript -PHP
source share