|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-06-16 08:58 UTC] sander@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 20:00:01 2025 UTC |
I'm using Debian Potato's deb packages (3.0.12-5). I used a file in which lines are longer than 8k. When I read a file into an array with the "file" function and after I use "join" to join the elements into a string, the length of the joined string equals with the file's size. But when I try to extract an item from the array, I only get back 8190 byte. The problem only occurs when I use an array which is constructed by "file". script to test with: <? $array = file("test.txt"); $file = join("",$array); $size = filesize("test.txt"); echo("Reading the file into an array...\nFilesize: $size, Read in: ".strlen($file)."\n\n"); $file = file("test.txt"); $first = $file[0]; $file = fopen("test.txt","r"); $second = fgets($file,1000000); fclose($file); echo("Reading with \"file\" and \"fgets\"...\nFirst: ".strlen($first)." Second: ".strlen($second)."\n\n"); ?> test.txt's first line must be longer than 8190 bytes! Thanks, Thifi