From: siegfri3d at gmail dot com Operating system: Linux debian sid, windows xp sp2 PHP version: 5.2.0 PHP Bug Type: Streams related Bug description: can't get partial contents with streams
Description: ------------ see bug http://bugs.php.net/bug.php?id=36857 The man answered but you never replied. He also posted an example on http://it2.php.net/file_get_contents on how to get a partial content with file_get_contents, it was working according to him, now it doesn't work anymore. For me it returns the whole content, maybe the syntax is wrong? If so it would be nice to correct it on the php.net page Reproduce code: --------------- <?php $context=array('http' => array ('header'=> 'Range: bytes=1-20', ),); $xcontext = stream_context_create($context); $str=file_get_contents("http://www.google.it",FALSE,$xcontext); echo $str; ?> Expected result: ---------------- that it returns the 20 first bytes of www.google.it. Actual result: -------------- It returns the whole page -- Edit bug report at http://bugs.php.net/?id=39745&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39745&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39745&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39745&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39745&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39745&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39745&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=39745&r=needscript Try newer version: http://bugs.php.net/fix.php?id=39745&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39745&r=support Expected behavior: http://bugs.php.net/fix.php?id=39745&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39745&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39745&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39745&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39745&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39745&r=dst IIS Stability: http://bugs.php.net/fix.php?id=39745&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39745&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39745&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39745&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=39745&r=mysqlcfg