Results 1 to 2 of 2

Thread: Turn blob of text with commas into <li></li>

  1. #1
    Join Date
    Nov 2005
    Location
    Austin TX,US
    Posts
    71
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Turn blob of text with commas into <li></li>

    In mysql db, I have a blob of text/string with commas separating different items like: car, muscle XXXXX bike, motocycle, 1234 abcd xfhsdah boat

    Is there a way to display this blob of text nicely into <li>car</li>, <li>muscle XXXXX bike</li>... considering the real list is much longer and every record of the db has this text of blob with different content.

    Thanks for the input!

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    PHP Code:
    $desc emplode(',',$source);
    echo 
    "<ul>";
    foreach(
    $desc as $d)
    {
          echo 
    "\n\t<li>"$d ."</li>";
    }
    echo 
    "</ul>"

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •