PDA

View Full Version : help with splitting string



genia
10-05-2008, 03:00 PM
hi,
i have kinda small problem that i cant workaround..
i have a string that contains expressions separated with comma:

$options="one,two,three";

now,i need to separate each expression and out between <li></li> tags.
how i do it?
i came to :

$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.

Master_script_maker
10-05-2008, 03:33 PM
try
$options="one,two,three";
$options2=str_replace("," , "</li><li>",$options);
$options2 = "<li>".$options2."</li>";

genia
10-05-2008, 03:47 PM
thank you very much.
this was exactly my problem-i didn't knew how to handle the begining and the end

thanks agin