|
Posted by Sean on 12/27/05 18:01
If you have a text file.
//numbers.txt
1
2
3
5
6
7
The resulting array (i.e. print_r(file('numbers.txt')); (
is
Array
(
[0] => 1
[1] => 2
[2] => 3
[3] =>
[4] => 5
[5] => 6
[6] => 7
)
which is what I would expect. Nothing so extraordinary about that.
New line or carriage return or whatever is still just a character (or
two characters if you use windows), and the manual spells out quite
clearly what happens.
"Note: Each line in the resulting array will include the line
ending, so you still need to use rtrim() if you do not want the line
ending present."
http://ie.php.net/file
Navigation:
[Reply to this message]
|