php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #53790 about "file_get_contents()"
Submitted: 2011-01-19 15:42 UTC Modified: 2011-01-26 21:39 UTC
From: fx4084 at gmail dot com Assigned: philip (profile)
Status: Closed Package: *General Issues
PHP Version: 5.2SVN-2011-01-19 (snap) OS: WIN7
Private report: No CVE-ID: None
 [2011-01-19 15:42 UTC] fx4084 at gmail dot com
Description:
------------
file_get_contents ( string filename [, bool use_include_path [, resource context 
[, int offset 
[, int maxlen]]]] )

I user this function like:
$fp = file_get_contents("http://www.example.com",0,NULL,3322,1024);

But, run this programe I get two warning:

Warning: file_get_contents() [function.file-get-contents]: stream does not 
support seeking in 
H:\htdocs\afx\media\games\index.php on line 5

Warning: file_get_contents() [function.file-get-contents]: Failed to seek to 
position 3322 in 
the stream in H:\htdocs\afx\media\games\index.php on line 5

I try it, The fourth parameter must less than 3322, why? Someone can tell me?

Test script:
---------------
<?php
//Example

$url = 'http://www.php.net';
$fp = file_get_contents($url,0,null,3321,1024); //No Warning.
$fp = file_get_contents($url,0,null,3322,1024); //Warning!! Just difference between 3322 and 3321

//I need to be a greater number. How can I do?
?>




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-26 20:05 UTC] cataphract@php.net
-Status: Open +Status: Duplicate
 [2011-01-26 20:05 UTC] cataphract@php.net
Duplicate of bug #46043.
 [2011-01-26 20:27 UTC] cataphract@php.net
-Status: Duplicate +Status: Open
 [2011-01-26 20:27 UTC] cataphract@php.net
I'm reopening as I didn't notice this was a doc bug.
 [2011-01-26 21:38 UTC] philip@php.net
Automatic comment from SVN on behalf of philip
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=307767
Log: - Document that the offset parameter does not work with remote files
- Mentioned when file_get_contents() emits E_WARNING errors
- Closes PHP Bug #53790
- Deals with PHP Bug #46043
 [2011-01-26 21:39 UTC] philip@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: philip
 [2011-01-26 21:39 UTC] philip@php.net
Thanks for the report, this has been documented and will show up online this 
upcoming Friday. Summary: offset does not work with remote files.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC