【问题标题】:how config php tidy extension?如何配置 php tidy 扩展?
【发布时间】:2015-07-25 13:26:06
【问题描述】:

如何配置整洁以使 html 内容整洁?并且没有 html 标签和 doctype 我希望当我给出整洁的"<p>ddddddd<lll>" 字符串时,它会返回我<p>dddddd</p> 而不是带有doctype 的html...
我使用了这个配置,但我应该怎么做才能得到我想要的结果?

    $config = array(
       'indent'         => true,
       'output-xhtml'   => true,
       'wrap'           => 200);
        $tidy = new tidy;
        $tidy->parseString($output.". . .",$config,'utf8');
        $tidy->cleanRepair();
        return $tidy;

有没有办法只设置编码而不发送配置参数?

【问题讨论】:

    标签: php


    【解决方案1】:

    仅使用显示正文

    $config = array(
           'output-xhtml' => true,
           'show-body-only' => true,
           'wrap' => 0, 
              );
    

    【讨论】:

      猜你喜欢
      • 2020-08-19
      • 2013-12-16
      • 1970-01-01
      • 2020-03-07
      • 1970-01-01
      • 2021-01-05
      • 1970-01-01
      • 2016-11-04
      • 2015-06-30
      相关资源
      最近更新 更多