$textvariable="This is some text..."; [green]\\variable that contains the string to convert.[/green]
$output=str_replace("[red]\n\r[/red]","</li><li>",$texvariable);
[green]\\replace the carriage returns or end of line with the <li></li> html for the lists."\n\r" are the characters for carriage return or new line [/green]
$output="<ul><li>" . $output ."</li></ul>";
[green]Finally add the beggining and ending <li> and if neccessary the <ul> and </ul> tags for the proper output of the list.[/green]