Re: Can't save multiple files if I'm using values pulled from another file...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux