What are the potential pitfalls of including unnecessary tabs or whitespace in PHP output?

Including unnecessary tabs or whitespace in PHP output can lead to unexpected output, such as extra spaces or line breaks in the rendered HTML. This can affect the layout and styling of the webpage, causing visual inconsistencies. To solve this issue, it's important to ensure that there are no unnecessary tabs or whitespace outside of PHP tags in your code.

<?php
ob_start();
?>
<!DOCTYPE html>
<html>
<head>
    <title>Example</title>
</head>
<body>
    <h1>Hello, World!</h1>
</body>
</html>
<?php
$output = ob_get_clean();
echo trim($output);
?>