You are here: Re: reading txt file - is empty line « All PHP « IT news, forums, messages
Re: reading txt file - is empty line

Posted by Jerry on 07/09/05 19:05

that helped - thanks



<id.at.w98.dot.us@gmail.com> wrote in message
news:1120884661.091885.323830@g49g2000cwa.googlegroups.com...
> if (!empty($buffer))
> fails because the line isn't empty, it contains only a carriage
> return/newline character.
>
> I would change the code to this:
>
> $buffer = fgets($handle, 4096);
> $buffer = str_replace("\n","",$buffer) ; // new code: delete newlines
> $buffer = str_replace("\r","",$buffer) ; // new code: delete carriage
> returns
> if (!empty($buffer))
>
> -id
>

 

Navigation:

[Reply to this 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

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