Mega Code Archive

 
Categories / Php / Code Snippets
 

Size of a webpage with PHP and cURL

<?php //googles $curl = curl_init('http://www.google.com'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE); curl_exec($curl); //get the download size of page print("Download size: " . curl_getinfo($curl, CURLINFO_SIZE_DOWNLOAD) .'<br>'); ?>