Reply to Re: last line of data written twice

Your name:

Reply:


Posted by Alvaro G. Vicario on 08/29/06 21:21

*** Patrick escribió/wrote (Tue, 29 Aug 2006 16:06:00 -0400):
> Can someone take a look at my script and tell me if I am missing
> something as to why the last line of data from my input file is being
> written twice in the echo. I have included a short sample of the data
> and the script.

I'd say it's because of the trailing line endings in the data file. If you
add more line endings, you get more duplicate lines.

You never reset the variables you use in sscanf() so for every line where
expected input is not found, the keep their previous value.

--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor con rayos UVA: http://www.demogracia.com
--

[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

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