I'm using the following code to create bb-style list tags. However, I want to try to make it be able to have a list tag within
<?php
$text = '[list]
[*] 1[/*]
[*] 2[/*]
[*] 3
[list]
[*]a[/*]
[*]b[/*]
[*]c[/*]
[/list]
[/*]
[*] 8[/*]
[/list]';
echo listtag($text);
function listtag($text){
$text = preg_replace('/\[list\](.*?)\[\/list\]/siU', '<ul>$1</ul>', $text);
$text = preg_replace('/\[\*\](.*)\[\/\*\]/', '<li>$1</li>', $text);
return $text;
}
?>
How could I modify this code to get it to work?