- Подробности
-
Категория: PHP. Сеть. Почта
Пример №1
var_dump( get_web_page('http://akosta.info') );
Пример №2
vWritePageToFile( 'http://www.akosta.info', 'es.php.net.txt' );
Короче как грузит и показывает сайт http://www.akosta.info
<?php
function vWritePageToFile( $sHTMLpage, $sTxtfile ) {
$sh = curl_init( $sHTMLpage );
$hFile = FOpen( $sTxtfile, 'w' );
curl_setopt( $sh, CURLOPT_FILE, $hFile );
curl_setopt( $sh, CURLOPT_HEADER, 0 );
curl_exec ( $sh );
$sAverageSpeedDownload = curl_getInfo( $sh, CURLINFO_SPEED_DOWNLOAD );
$sAverageSpeedUpload = curl_getInfo( $sh, CURLINFO_SPEED_UPLOAD );
echo '<pre>';
echo 'Average speed download == ' . $sAverageSpeedDownload . '<br>';
echo 'Average Speed upload == ' . $sAverageSpeedUpload . '<br>';
echo '<br>';
$aCURLinfo = curl_getInfo( $sh );
print_r( $aCURLinfo );
echo '</pre>';
curl_close( $sh );
FClose ( $hFile );
echo '(<b>See the file "'.$sTxtfile.'" in the same path of the hosting'.
' to where this script PHP</b>).<br>';
}
?>