php - HTML tidy - remove spaces between tags? how to reverse "tidying"? -
Then I use the trimmed to properly format html:
$ html = 'one row with html many tags'; $ config = array ('indent' = & gt; true; 'indent-spaces' = & gt; 2, 'show-body-only' => true, 'rap' => gt; $ Clean = new \ systematic; $ Clean-> Parse string ($ html, $ config, 'utf8'); $ Tidy-> cleanRepair (); / / This output is cleaned with the echo of the string; Then this tidied version is thrown in the ACE editor where the user manages things and saves that HTML section. So when I save it - & gt; I want it to be "United Nations", which means that line breaks or tag indentation should not be included. How to achieve this I have no reason to use the library?
\ r or \ n or both Use a pregg to match and nothing changes him. preg_replace ("/ \ r | \ N /", "", $ ACE); As far as removing indentation is concerned, it is just white space, which is the function of PHP trim Trim can be removed from $ = trim ($ AE); Next, the trim accepts a second argument that you can pass and also squeeze out: $ trimmed = trim ($ ACE) , '\ t.'); For example the tab character will be trimed.
Comments
Post a Comment