1
我有一个html的一些特殊的html字符,如
...但整洁使�
这个字符作为空间。php tidy没有休息空间
// tidy config
$tidyConfig = array(
'indent' => true,
'output-xhtml' => true,
'input-encoding' => 'utf8',
'output-encoding' => 'utf8',
'show-body-only' => true,
'fix-backslash' => true,
'quote-marks' => true,
'wrap' => 1024,
);
// tidy up
$string = (string)tidy_parse_string($string, $tidyConfig);
必须设置或更改什么选项。
结果http://codepad.viper-7.com/bsqD0n
你尝试,你之前用空间代替' '运行'tidy'? – Peon 2012-07-31 10:48:39
@DainisAbols有什么更好的方法来整理? – sweb 2012-07-31 10:54:38
检查你的输入编码:它确实是utf-8吗? – madflow 2012-07-31 11:21:55