To już:
$content = '';
if( $handle = @fopen( 'http://strona.pl/index.html', 'r' ) )
{
while( !feof( $handle ) )
{
$content .= fgets( $handle );
}
fclose( $handle );
}
Ew.:
$url = 'http://strona.pl/index.html';
$url = $url . '/';
if( preg_match( '/^http:\/\/(.+?)\//', $url, $match ) )
{
if ( $handle = @fsockopen( $match[1], 80, $en, $es, 3 ) )
{
fwrite( $handle, "GET $url HTTP/1.1\r\n\r\n" );
$content = '';
while( !feof( $handle ) )
{
$content .= fgets( $handle );
}
fclose( $handle );
}
}