[英]Remove white spaces between tags in HTML
我正在使用以下代碼刪除 html 中的空格。 我只想刪除標簽之間的空格。 但下面的代碼替換了所有空格
IE 刪除“>”和“<”之間的所有空格
//read the entire string
$str=file_get_contents('sample.txt');
//replace all white spaces
$str=str_replace("\n", "",$str);
$str=str_replace("\t", "",$str);
$str=str_replace(" ", "",$str);
//write the entire string
file_put_contents('sample.txt', $str);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.