Can you use file() and rtrim() together
| From: | blulagoon | Date: | Mon, 06 May 2002 12:23:33 +0000 |
| Subject: | Can you use file() and rtrim() together | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-13571@lists.php.net to get a copy of this message | ||
I don't know if this is the right way to go about what I'm trying to do.
In a nutshell, I want to open a simple text file and load the file into
an array with each line represented by one element in the array.
Now $myArray = @file("my_text_file"); achieves 90% of what I want, but I
need to strip out the line feeds at the end of each line that are in the
original file.
rtrim($myString, "/n") would seem to offer this functionality, but I
can't figure out the best way to use it with an array ?
Anyone got this working, or is there another easier way to do it,
perhaps with a variant of file() which doesn't include the linefeeds
that I don't know about.
Looking forwards to your input guys .....
Blu.