You are here: Re: changing old values to new values « PHP Programming Language « IT news, forums, messages
Re: changing old values to new values

Posted by Steve on 04/19/07 04:27

| // Strip carrage-returns
| for($c = 0; $c < count($contents)-1; $c++)
| {
| $contents[$c] = str_replace( "n", "", $contents[$c] );
|
| }

you do realize that this may be your problem?

it should be str_replace("\n", '', $contents[$c]) ...otherwise, you're just
stripping the letter 'n'. likewise, later when you implode $contents, you
concatenate the records with the letter 'n' again. what i don't understand
is why you are stripping \n anyway since you implode using \n. why not just
make $update/$replace_text end with \n, replace the correct element and be
done with it. your implode can simply implode('', $contents)...since \n is
already inclusive given that you use file().

does that help?

 

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

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