Reply to Re: [PHP] Can't save multiple files if I'm using values pulled from another file...

Your name:

Reply:


Posted by Jason Wong on 03/03/05 16:06

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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация