I am using the following code to remove white spaces in html. I only want to remove white spaces in betweens tags. But below code replaces all white spaces
I.E remov
You need use a regular expresion.
Maybe you can use this:
$html = preg_replace('/\>\s+\</m', '><', $html);
Test here https://repl.it/