PHP does not have any built-in functions that directly support this. Writing your own would be far from trivial. My recommendation would be to search the web for existing scripts that do this conversion.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
I can't see how it could even be possible. PDF documents have layout while HTML documents do not; and PDF documents have a page size while HTML documents do not even have pages. I would make a comparison between this and doing a .doc to a .txt conversion where all formatting would be lost in the process. Even a sledgehammer like Google with its massive resources can't get this right. Just try the convert pdf >> html feature on its search page to see what I mean.
Obviously if the converssion were the other way around (HTML >> PDF... .txt >> .doc) it would be easy and there is plenty of software that can do this... fpdf for example.
Online Tool to Convert Webpage(HTML) into PDF Format
You may be saving a webpage as a html file to read it offline. But instead of saving it as html, you can convert a webpage into pdf format. This can prove to be more effective way of viewing data offline.
http://html-2-pdf.com is an online tool to convert webpages into PDF(Portable Document Format) documents. It’s basically an online converter which could transform any websites to a PDF document. Generally it could be more useful if you want to print a website.
for more info read my blog http://blogbyanoopsharma.wordpress.com/