I have seen a few questions about this problem, but any answers haven't worked in my case.
I have textarea input in wordpress block, if someone will enter a text like this:
Lorem ipsum
Dolor sit
Amet
I need to get every new line as </li>
tag, I was trying to do something like this:
$textAreaData = $PriceListItem[PriceListConfig::ITEMS_LIST_DESCRIPTION];
$textAreaDataList = "<li>" . str_replace("\n", "</li>\n<li>",trim($textAreaData, "\n"));
but it didn't work, can anyone please tell me, what am I doing wrong?
Thank you