ITPub博客

首页 > 应用开发 > IT综合 > discuz bbcode与html 的互相转换

discuz bbcode与html 的互相转换

IT综合 作者:yaoguocai 时间:2017-10-17 16:49:39 0 删除 编辑

点击(此处)折叠或打开

  1. $str = "<b><i>的的顶顶顶顶顶的顶顶顶顶顶顶顶顶顶的的</i></b>";
  2. //html转成bbcode
  3. require_once libfile('function/editor');
  4. echo html2bbcode($str);

  5. echo "</br>";

  6. $str2 = '[b][i]的的顶顶顶顶顶的顶顶顶顶顶顶顶顶顶的的[/i][/b]';
  7. //将bbcode转成html
  8. require_once libfile('function/discuzcode');
  9. echo discuzcode($str2, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0);

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29679106/viewspace-2146072/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-05-27

  • 博文量
    19
  • 访问量
    13712