I have a database table that will store a description of a product. I want the user to be able to insert custom “[FEATURES]” tags to be able to list all of the features of the product quickly or without having to use a WYSIWYG editor or having to write their own html. So as shown below, the user will be able to specify the opening features tag and closing features tag list like so :
[FEATURES]
Feature # 1 would go here!
Feature # 2 would go here!
Feature # 3 would go here!
Feature # 4 would go here!
Feature # 5 would go here!
[/FEATURES]
So as shown above this is how the user would specify the list of features, but I would want them output in an un-ordered list like below:
<ul>
<li>Feature # 1 would go here!</li>
<li>Feature # 2 would go here!</li>
<li>Feature # 3 would go here!</li>
<li>Feature # 4 would go here!</li>
<li>Feature # 5 would go here!</li>
</ul>
I was hoping I could use the simple str_replace function
str_replace("\n", "<li>", $string)
but I’m having trouble trying to figure how how to properly do so.
Any help is greatly appreciated.