|
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?
[Back to original message]
|