Remove whitespace from HTML

前端 未结 15 1814
花落未央
花落未央 2020-12-28 14:25

I have HTML code like:

15条回答
  •  不知归路
    2020-12-28 14:54

    $html = preg_replace('~>\s+<~', '><', $html);

    But I don't see the point of this. If you're trying to make the data size smaller, there are better options.

提交回复
热议问题