note 71556 modified in function.file-get-contents by danbrown
| From: | danbrown@php.net | Date: | Fri, 06 Jan 2012 20:05:55 +0000 |
| Subject: | note 71556 modified in function.file-get-contents by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-185429@lists.php.net to get a copy of this message | ||
Use the previous example if you want to request the server for a special part of the content, IF and
only if the server accepts the method.
If you want a simple example to ask the server for all the content, but only save a portion of it,
do it this way:
<?php
$content=file_get_contents("http://www.google.com",FALSE,NULL,0,20);
echo $content;
?>
This will echo the 20 first bytes of the google.com source code.
--was--
Use the previous example if you want to request the server for a special part of the content, IF and
only if the server accepts the method.
If you want a simple example to ask the server for all the content, but only save a portion of it,
do it this way:
<?
$content=file_get_contents("http://www.google.com",FALSE,NULL,0,20);
echo $content;
?>
This will echo the 20 first bytes of the google.com source code.
http://php.net/manual/en/function.file-get-contents.php