You are here: Re: Class not outputting all variables « All PHP « IT news, forums, messages
Re: Class not outputting all variables

Posted by Hilarion on 07/11/05 13:35

ScareCrowe wrote:
> Okay, I figured out that the file() func is adding the newline to the
> variable, so switch() is not matching.
> I have tried using trim(), rtrim(), str_replace() etc but none of these func
> will eliminate the newline

According to the manual trim and rtrim do remove newline chars, so you
probably have some errors in the code. Post it (the code) here, so we
could check what's wrong with it.

You could also use:

$lines = file( 'some_file.txt' );
for( $i=0; $i < count( $lines ); $i++ )
$lines[ $i ] = trim( $lines[ $i ] );


Hilarion

 

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

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