Convert textbox field to bulleted list

3 posts by 2 authors in: Forums > CMS Builder
Last Post: June 1, 2010   (RSS)

Re: [zip222] Convert textbox field to bulleted list

By Jason - June 1, 2010

Hi,

Yes, you can do this with PHP. First, you have to turn your content into an array like this:
$list = explode("<br/>",trim($content,"<br/>"));
Just replace $content with your content from the database. After that, you just need to use a foreach loop to output your list.

<ul>
<?php foreach($list as $item): ?>
<li><?php echo $item ?></li>
<?php endforeach ?>
</ul>


Give that a try.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Convert textbox field to bulleted list

By zip222 - June 1, 2010

perfect. and very useful.