1
4

1 回答 1

1

How about this? http://codepad.viper-7.com/B5PDFc

bare Top Type: Boolean Default: no Example: y/n, yes/no, t/f, true/false, 1/0
This option specifies if Tidy should strip Microsoft specific HTML from Word 2000 documents, and output spaces rather than non-breaking spaces where they exist in the input.

$string = 'word word   word';

// tidy config
$tidyConfig = array(
    'indent' => true,
    'output-xhtml' => false,
    'input-encoding' => 'utf8',
    'output-encoding' => 'utf8',
    'show-body-only' =>true,
    'fix-backslash' => true,
    'quote-marks' => true,
    'wrap' => 1024,
    'bare' => true,
);

// tidy up
var_dump((string)tidy_parse_string($string, $tidyConfig));

*The output-xhtml (false) is something I experimented with, but it makes no difference regarding the output (in this case)

于 2012-07-31T11:33:18.673 回答