dedart Posted April 23, 2006 Share Posted April 23, 2006 Hi, I have a script where I am converting html back to BBCODE for editing and I am having trouble with certain parts of the script[code]$patterns = array ( "|\<b\>(.*?)\</b\>|s", "|\<i\>(.*?)\</i\>|s", "|\<u\>(.*?)\</u\>|s", "|\<strike\>(.*?)\</strike\>|s", "|\<div style=\"font-size: 14px; color=:#E1B500;\"\>\<b\>QUOTE:\</b\>\</font\>\<div style=\"border: 1px; border-style: solid; background-color: #FFF0B3;\"\>(.*?)\</div\>\</div\>|s");$replacements = array ( "[ B]\$1[ /B]", "[ I]\$1[ /I]", "[ U]\$1[ /U]", "[ STRIKE]\$1[ /STRIKE]", "[ QUOTE]\$1[ /QUOTE]");[/code]If I have a html string like: <div style="font-size: 14px; color=:#E1B500;"><b>QUOTE:</b></font><div style="border: 1px; border-style: solid; background-color: #FFF0B3;">SOME TEXT</div></div>The page will output: [ B]QUOTE:[ /B]SOME TEXTI have tried re-arranging the arrays and even adding the bbcode bolds to the html string but nothing seems to be workingCAN SOMEONE PLEASE HELP ME, IT'S DRIVING ME CRAZYdedart Quote Link to comment Share on other sites More sharing options...
dedart Posted April 24, 2006 Author Share Posted April 24, 2006 Anyone help? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.