Posted by Stefan Rybacki on 01/08/06 16:32
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Pete wrote:
>> The problem is your "\n", since $arr2[$i] already seem to contains the
>> line end
>> character.
>
> Thanks. I guess it reads a "\n" from the file too. It thought "\n" worked as
> a seperator for the file_lines array:
> $file_lines = file($filename);
>
> Is there any way to read each line in the file into an array without the
> line break at the end of each line?
if you just need one line at a time you could use fopen in combination with
fgets and trim to remove the ending linebreak.
If you want to go ahead with the array you got from file() you can trim those
lines as well using trim()
Regards
Stefan
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1rc2 (MingW32)
iD8DBQFDwSJ9yeCLzp/JKjARArvUAJ0WUih/2Bn8PllfMRfXUiYq0zCNsACcDZ3e
Ht7/XyGKiu8KG/rCFDEbcSw=
=F4E9
-----END PGP SIGNATURE-----
Navigation:
[Reply to this message]
|