Re: Can't save multiple files if I'm using values pulled from another file...
| From: | Jason Wong | Date: | Thu, 03 Mar 2005 14:06:22 +0000 |
| Subject: | Re: Can't save multiple files if I'm using values pulled from another file... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-209912@lists.php.net to get a copy of this message | ||
On Thursday 03 March 2005 19:53, Foofy wrote:
> I'm writing a script that transfers files from a list file and saves
> them locally. M
>
> If I use values from the list for the filenames of the saved files, it
> appears that none of the files are saved 'cept for the last one. If I
> put the values in an array directly in the script file, all is well. I
> have confirmed that the values are different and I've tried other
> methods to load the file, such as fgets. Here is a simplified version
> of my script that has the same problem:
Thank you for helping others to help you by constructing a simplified
example.
> <?php
> $linklist = file('links.txt');
file() -> "... each element of the array corresponds to a line in the
file, with the newline still attached ..."
That's most likely your problem. The last line of your file most likely
does not have a trailing NL character that is why it is the only line
that works.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
New Year Resolution: Ignore top posted posts