I have HTML code like:
15条回答 时光取名叫无心 (楼主) 2020-12-28 14:38 $html = preg_replace('~>\s*\n\s*<~', '><', $html); I'm thinking that this is the solution to the Hello world problem. The idea is to remove whitespace only when there's a new line. It will work for common HTML syntax which is: 0 讨论(0) 查看其它15个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复 热议问题
$html = preg_replace('~>\s*\n\s*<~', '><', $html);
I'm thinking that this is the solution to the Hello world problem. The idea is to remove whitespace only when there's a new line. It will work for common HTML syntax which is:
Hello world