|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-10-11 15:59 UTC] uk_gavin_uk at hotmail dot com
[2004-10-11 20:33 UTC] iliaa@php.net
[2005-04-04 19:58 UTC] sniper@php.net
[2005-04-05 05:00 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 06:00:01 2025 UTC |
Description: ------------ - Downloaded and using php-5.0.2-Win32.zip from www.php.net - Confirmed md5 hash using stream_get_line() on a file I get data returned to me but not in the manner expected or documented?? It's best you look at the Reproduce code, but it looks like the function reads up until the first instance of the delimiter specified, but on subsequent calls it ignores the delemeter and reads in the number of chars it did on the first call?? Reproduce code: --------------- <?php $resource = fopen('C:/test/import/file.txt', 'rb'); for ($i = 0; ($i < 10) && !feof($resource); ++$i ) { $line = stream_get_line($resource, 50, $a); echo $line . "\n"; } fclose($resource); ?> FILE.TXT: 111Y111111111Y111111111Y111111111Y111111111Y111111111Y111111111Y111111111Y111111111Y111111111 Expected result: ---------------- 111 111111111 111111111 111111111 111111111 111111111 111111111 111111111 Actual result: -------------- 111 Y11 111 111 1Y1 111 111 11Y 111 111