Preserve Line Breaks - Simple HTML DOM Parser

后端 未结 5 2131
忘掉有多难
忘掉有多难 2021-02-01 18:21

When using PHP Simple HTML DOM Parser, is it normal that line breaks
tags are stripped out?

5条回答
  •  感动是毒
    2021-02-01 18:27

    Another option should one wish to preserve other formatting such as paragraphs & headings is to use innertext rather than plaintext then perform your own string cleaning with the result.

    I realise there is a performance hit but it does allow for more granular control.

提交回复
热议问题