From: "Jo�o C�ndido de Souza Neto" on
I�ve got a file with only one line 21917 characters long but when I read
this file using $varData = file_get_contents("file.txt") it gets only 21504
characters.

Anyone would know why does it happen?

Thanks in advance.

--
Jo�o C�ndido de Souza Neto


From: Ashley Sheridan on
On Tue, 2010-06-29 at 16:53 -0300, Jo?o C?ndido de Souza Neto wrote:

> Ive got a file with only one line 21917 characters long but when I read
> this file using $varData = file_get_contents("file.txt") it gets only 21504
> characters.
>
> Anyone would know why does it happen?
>
> Thanks in advance.
>
> --
> Joo Cndido de Souza Neto
>
>
>


Are the characters stripped off of the end of the file after that point,
or is the encoding not correctly determined and some characters are
converted the wrong ones?

Thanks,
Ash
http://www.ashleysheridan.co.uk


From: "Jo�o C�ndido de Souza Neto" on
The characters are stripped off of the end of the file after that point.

--
Jo�o C�ndido de Souza Neto

"Ashley Sheridan" <ash(a)ashleysheridan.co.uk> escreveu na mensagem
news:1277841481.2253.39.camel(a)localhost...
> On Tue, 2010-06-29 at 16:53 -0300, Jo?o C?ndido de Souza Neto wrote:
>
>> Ive got a file with only one line 21917 characters long but when I read
>> this file using $varData = file_get_contents("file.txt") it gets only
>> 21504
>> characters.
>>
>> Anyone would know why does it happen?
>>
>> Thanks in advance.
>>
>> --
>> Joo Cndido de Souza Neto
>>
>>
>>
>
>
> Are the characters stripped off of the end of the file after that point,
> or is the encoding not correctly determined and some characters are
> converted the wrong ones?
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>


From: Ashley Sheridan on
On Tue, 2010-06-29 at 17:02 -0300, Jo?o C?ndido de Souza Neto wrote:

> The characters are stripped off of the end of the file after that point.
>
> --
> Joo Cndido de Souza Neto
>
> "Ashley Sheridan" <ash(a)ashleysheridan.co.uk> escreveu na mensagem
> news:1277841481.2253.39.camel(a)localhost...
> > On Tue, 2010-06-29 at 16:53 -0300, Jo?o C?ndido de Souza Neto wrote:
> >
> >> Ive got a file with only one line 21917 characters long but when I read
> >> this file using $varData = file_get_contents("file.txt") it gets only
> >> 21504
> >> characters.
> >>
> >> Anyone would know why does it happen?
> >>
> >> Thanks in advance.
> >>
> >> --
> >> Joo Cndido de Souza Neto
> >>
> >>
> >>
> >
> >
> > Are the characters stripped off of the end of the file after that point,
> > or is the encoding not correctly determined and some characters are
> > converted the wrong ones?
> >
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
> >
> >
>
>
>

Have you looked at the memory settings in php.ini?

Thanks,
Ash
http://www.ashleysheridan.co.uk


From: Andrew Ballard on
On Tue, Jun 29, 2010 at 4:21 PM, Ashley Sheridan
<ash(a)ashleysheridan.co.uk> wrote:
> On Tue, 2010-06-29 at 17:02 -0300, Jo?o C?ndido de Souza Neto wrote:
>
>> The characters are stripped off of the end of the file after that point.
>>
>> --
>> Joo Cndido de Souza Neto
>>
>> "Ashley Sheridan" <ash(a)ashleysheridan.co.uk> escreveu na mensagem
>> news:1277841481.2253.39.camel(a)localhost...
>> > On Tue, 2010-06-29 at 16:53 -0300, Jo?o C?ndido de Souza Neto wrote:
>> >
>> >> Ive got a file with only one line 21917 characters long but when I read
>> >> this file using $varData = file_get_contents("file.txt") it gets only
>> >> 21504
>> >> characters.
>> >>
>> >> Anyone would know why does it happen?
>> >>
>> >> Thanks in advance.
>> >>
>> >> --
>> >> Joo Cndido de Souza Neto
>> >>
>> >>
>> >>
>> >
>> >
>> > Are the characters stripped off of the end of the file after that point,
>> > or is the encoding not correctly determined and some characters are
>> > converted the wrong ones?
>> >
>> > Thanks,
>> > Ash
>> > http://www.ashleysheridan.co.uk
>> >
>> >
>> >
>>
>>
>>
>
> Have you looked at the memory settings in php.ini?
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>

I doubt that is the cause, at least not by itself. 21504 characters is
only 21K of data (could be more if the characters are multi-byte
encoded, but still less than 100K) , and the default memory limit in
PHP is 128M. I'm not sure what else it could be, though, as I don't
see any limitations on file_get_contents() discussed in the manual.

Andrew