file() file_get_contents() characters limitation?

Hello firends,
When i try to get the content of an external file using file() (preferred) i cant get the entire content…

The problem is the file isnt that big (< 30 lines, 4kbs) ill give the example:

the entire file using file_get_contents():

[size=7pt] Alucard -A-Wars 1x1 Mage 4 1 2011/08/14 02:24:18 ironman -A-Wars 1x1 Mage 4 4 2011/08/14 05:50:25 Joga Nada -A-Wars 1x1 Mage 8 4 2011/08/14 21:43:29 BlindFaith -A-Wars 5x5 10 2 2011/08/14 23:59:53 Lord Angel -A-Wars 5x5 10 2 2011/08/14 23:59:53 Meu Ovo -A-Wars 5x5 10 2 2011/08/14 23:59:53 Sao Silvestre -A-Wars 5x5 10 2 2011/08/14 23:59:53 Palmeiras -A-Wars 5x5 10 2 2011/08/14 23:59:53 CoCa CoLa -A-Wars 2x2x2x2 8 4 2011/08/15 19:03:02 Babalu -A-Wars Pancadaria 3x3x3x3 12 4 2011/08/15 20:47:39 Cypress Hill -A-Wars Pancadaria 3x3x3x3 12 4 2011/08/15 20:47:39 renan -A-Wars 4x4x4x4 16 4 2011/08/15 22:03:04 Sao Silvestre -A-Wars 4x4x4x4 16 4 2011/08/15 22:03:04 Clark Kent -A-Wars 4x4x4x4 16 4 2011/08/15 22:03:04 Stanic -A-Wars 4x4x4x4 16 4 2011/08/15 22:03:04 Sao Silvestre -A-Wars 2x2 Mage 16 8 2011/08/15 22:20:17 Judas -A-Wars 2x2 Mage 16 8 2011/08/15 22:20:17 CoCa CoLa -A-Wars Evento Times 8 2 2011/08/15 22:53:17 Black Space -A-Wars Evento Times 8 2 2011/08/15 22:53:17 Venda a Gavea -A-Wars 5x5 10 2 2011/08/16 22:09:53 Shadown -A-Wars 5x5 10 2 2011/08/16 22:09:53 Nosso Ovo -A-Wars 5x5 10 2 2011/08/16 22:09:53 PaO com DureX -A-Wars 5x5 10 2 2011/08/16 22:09:53 Nosso Ovo -A-Wars 1x1 Warrior 8 8 2011/08/16 22:42:30 Sao Silvestre -A-Wars 2x2x2x2 8 4 2011/08/18 16:50:33 CoCa CoLa -A-Wars 2x2x2x2 8 4 2011/08/18 16:50:33 Palmeiras -A-Wars 1x1 Warrior 4 4 2011/08/19 14:29:42 antherao -A-Wars 1x1 Mage 4 4 2011/08/19 14:41:50 Beterraba -A-Wars 5x5 10 2 2011/08/19 22:14:05 Joga Nada -A-Wars 5x5 10 2 2011/08/19 22:14:05 HiGuAiN -A-Wars 5x5 10 2 2011/08/19 22:14:05 Sao Silvestre -A-Wars 5x5 10 2 2011/08/19 22:14:05 [/size]

The output:

[size=7pt] Alucard -A-Wars 1x1 Mage 4 1 2011/08/14 02:24:18 ironman -A-Wars 1x1 Mage 4 4 2011/08/14 05:50:25 Joga Nada -A-Wars 1x1 Mage 8 4 2011/08/14 21:43:29 BlindFaith -A-Wars 5x5 10 2 2011/08/14 23:59:53 Lord Angel -A-Wars 5x5 10 2 2011/08/14 23:59:53 Meu Ovo -A-Wars 5x5 10 2 2011/08/14 23:59:53 Sao Silvestre -A-Wars 5x5 10 2 2011/08/14 23:59:53 Palmeiras -A-Wars 5x5 10 2 2011/08/14 23:59:53 CoCa CoLa -A-Wars 2x2x2x2 8 4 2011/08/15 19:03:02 Babalu -A-Wars Pancadaria 3x3x3x3 12 4 2011/08/15 20:47:39 Cypress Hill -A-Wars Pancadaria 3x3x3x3 12 4 2011/08/15 20:47:39 renan -A-Wars 4x4x4x4 16 4 2011/08/15 22:03:04 Sao Silvestre -A-Wars 4x4x4x4 16 4 2011/08/15 22:03:04 Clark Kent -A-Wars 4x4x4x4 16 4 2011/08/15 22:03:04 Stanic -A-Wars 4x4x4x4 16 4 2011/08/15 22:03:04 Sao Silvestre -A-Wars 2x2 Mage 16 8 2011/08/15 22:20:17 Judas -A-Wars 2x2 Mage 16 8 2011/08/15 22:20:17 CoCa CoLa -A-Wars Evento Times 8 2 2011/08/15 22:53:17 Black Space -A-Wars Evento Times 8 2 2011/08/15 22:53:17 Venda a Gavea -A-Wars 5x5 10 2 2011/08/16 22:09:53 Shadown -A-Wars 5x5 10 2 2011/08/16 22:09:53 Nosso Ovo -A-Wars 5x5 10 2</t[/size]

I didn’t see anyone on internet talking about this problem (small files)

i can’t even use
[php]$file file(‘external_file’);
echo $file[25];[/php]
Cuz it cant read the line 25

Something i can do on my php.ini?

Very thankful, Chinchila.

Hi there,

Strange issue, but out of interest try this:
[php]$filecontents = implode("\n",file(‘thefile.txt’));
echo $filecontents;[/php]

(oh and check the page source to make sure it’s definitely not outputting all the characters - or output it into a textarea element so it doesn’t try to read any tags)

$filecontents = implode("\n",file(‘thefile.txt’));
echo $filecontents;

Incomplete data too :confused:

try to read file without file().

you can open the file with fopen and use fread.

The limitation are in apache config.

I used everything
fopen
fread
file
file_get_contents

@kikesv
So I can’t change it no php.ini?

Is it a big deal for the servers healthy? Because this is a paying host (justhost.com), and if it is a simple task i will complain about that…

Has you go a BD?

What are you thinking to do with this data?

The problem is memory, but you can write on a temporary table in a bd an use data from this…

I already got some functions using curls to resolve this but i really want to fix this problem from the “root”

It is a paying host… it should be working right?

Limiting small files like that is wrong in a paying host

Sponsor our Newsletter | Privacy Policy | Terms of Service