Hello everyone!
here's my code:
PHP Code:
new f = fopen(file, "rt")
while (f && !feof(f))
{
fgets(f, temp2, 1023)
replace(temp2, 1023, "^n", "")
}
The thing is that it will fail if i load window line format files on linux...
what do i mean by linux&window line format:
window's one:
[IMG]http://s29.************/8wigyi987/window.png[/IMG]
line: 13 10 or 0D0A ( 2 bytes )
linux's one:
[IMG]http://s13.************/f4nkzitjr/linux.png[/IMG]
line: 10 or 0A ( 1 byte )
for example loading windows lines in linux will cause fgets to get whole file, i assume that because
while i was debugging the code, loop did only one cycle.
I dont know how windows will react to linux lines, never tried it. Didn't find it that important i guess...
Anyideas how to fix my problem here?
Thanks!
edit:
one solution would be using fread i guess.
Calling fread for every char but this is just too bad, i better code module and parse things there but i was hoping there's another way.