How does HTML rendering affect the display of white spaces in PHP output?

When HTML is rendered, consecutive white spaces are collapsed into a single space by default. To preserve white spaces in PHP output, you can use the HTML entity ` ` for each space you want to display.

<?php
// Output with preserved white spaces
echo "This   is   a   test";
?>