redbrad0 Posted September 23, 2008 Share Posted September 23, 2008 I am trying to figure out how to take some text which contains BB code and replace the LIST with a actual HTML. A example of the BBC code is listed below. [list] [*]Item one [b][u]bold underline[/b][/u][/*] [*]Item two[/*] [*]Item three [i][u]italic underline[/i][/u][/*] [/list] I do not need it to include anything except support for LIST items. Can someone help me with this Reg expression? I was able to get everything else figured out except for this one. Link to comment https://forums.phpfreaks.com/topic/125533-convert-bb-code-to-html-for-list-items/ Share on other sites More sharing options...
Lodius2000 Posted September 23, 2008 Share Posted September 23, 2008 look into str_replace() make an array of bbcode and a matching array of html, pass the string to it and you're done Link to comment https://forums.phpfreaks.com/topic/125533-convert-bb-code-to-html-for-list-items/#findComment-649081 Share on other sites More sharing options...
redbrad0 Posted September 24, 2008 Author Share Posted September 24, 2008 Im such a idiot, thanks... I was thinking I needed to use a regexp like I did for the URL and font colors. Thanks for pointing me into a easier way using the same code I did for bold, italic etc Link to comment https://forums.phpfreaks.com/topic/125533-convert-bb-code-to-html-for-list-items/#findComment-649200 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.