function to calculate display height of html+css
===

(Following this question: http://stackoverflow.com/questions/11536806/html-columns-whose-width-automatically-changes-according-to-their-content )

From a PHP script, I print some HTML code, and I would like to know what will be the height of the result (for paging calculation). Suppose I have the following input:

 - $html code I want to print (string);
 - $css code, with full details of the font and size of all items that appear in the HTML (string);
 - page $width, in pixels (int).

I create a page that looks like this:

    <html>
      <head>
        <style>$css</style>
      </head>
      <body style='width:$width'>
        $html
      </body>
    </html>

I want to know, from within the PHP script, the number of pixels from the top of the page to the bottom of the text.
