I've stepped into this project, and I've been asked to solve a sticky issue, and I feel like I'm chasing a ghost. Hopefully some of you will have seen this before and can give me some direction.
The problem we are facing is the rendered website does not play well with IE9. JavaScript functionality dies when viewed in IE9. It does fine in IE8 and 10.

When looking at the source, I see the following:


<blank line>
<blank line>
<blank line>
<!-- --><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
In the code that generates the page, the original programmer is using this:

PHP Code:
ob_start(); // Start the Output buffer
include $DIR['templates'].'/'.$template;  // include and process the file
$html ob_get_clean(); // get the contents of the output buffer 
The template being used has no white space above the DOCTYPE tag.

When $html is printed/echoed the code is simply,

PHP Code:
print $html
I tried,

PHP Code:
print trim($html); 
but, that didn't strip those top lines.

The reason I'm focused on those lines is because it appears that it's messing with the headers and IE9 is freaking out.

I'm really at a loss and could use some help.