使用curl时获得完整的<Doctype>

I want to get

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

but i am getting

<!DOCTYPE html>
<html lang="en" id="facebook" class="no_js">

after using curl to get HTTP response body in php from the below code

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'http://www.facebook.com/');
$file=fopen("/var/www/myapp/welcome.txt","w+");
curl_setopt($ch, CURLOPT_FAILONERROR,1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch,CURLOPT_COOKIE,"PHPSESSID=5b1sXXXXo5niv5p0t24ntbh56X;fusion_user=13XXX.cXXX282138afbe9066b8be1cb426841d");
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; U; Linux i686; it; rv:1.8.1.5) Gecko/20070713 Firefox/2.0.0.5");
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_FILE, $file);
$retValue = curl_exec($ch); 
fclose($file); 
curl_close($ch);

Change http://www.facebook.com/ to the URL of a page with the Doctype you want.

Facebook uses the Doctype you are getting.

Facebook uses the HTML5 Doctype - Which is just <!DOCTYPE html> - You'll be able to see that in the source code for facebook.com