Results 1 to 3 of 3

Thread: help with splitting string

  1. #1
    Join Date
    Jan 2008
    Posts
    73
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default help with splitting string

    hi,
    i have kinda small problem that i cant workaround..
    i have a string that contains expressions separated with comma:
    Code:
    $options="one,two,three";
    now,i need to separate each expression and out between <li></li> tags.
    how i do it?
    i came to :
    Code:
    $options2=str_replace("," , "</li>",$options);
    but how to put the <li> on the begining ?

    thanks in advance
    and sorry for english mistakes..it's my 3rd languge.
    Last edited by genia; 10-05-2008 at 03:17 PM.

  2. #2
    Join Date
    Jun 2007
    Posts
    543
    Thanks
    3
    Thanked 78 Times in 78 Posts
    Blog Entries
    1

    Default

    try
    Code:
    $options="one,two,three";
    $options2=str_replace("," , "</li><li>",$options);
    $options2 = "<li>".$options2."</li>";
    [Jasme Library (Javascript Motion Effects)] My Site
    /\/\@§†ê® §©®¡þ† /\/\@|{ê®
    There are 10 kinds of people in the world, those that understand binary and those that don't.

  3. #3
    Join Date
    Jan 2008
    Posts
    73
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    thank you very much.
    this was exactly my problem-i didn't knew how to handle the begining and the end

    thanks agin

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
  •