Trim not removing end newline characters?
<p>This should be fairly straightforward. Say I have the following code:</p>

<pre><code>$output = file_get_contents($random_name . ".txt");
echo "&lt;pre&gt;";
echo str_replace("\n", "\nN ", $output);
echo "&lt;/pre&gt;";
</code></pre>

<p>And <code>$output</code> looks like this:</p>

<pre><code>PDF Test File
N Congratulations, your computer is equipped with a PDF (Portable Document Format)
N reader! You should be able to view any of the PDF documents and forms available on
N our site. PDF forms are indicated by these icons:
N or.
N 
N 
</code></pre>

<p>And let's say I want to get rid of those two last newline characters, through the following:</p>

<pre><code>$outputTrimmed = trim($output, "\n");
</code></pre>

<p>I would assume, that would output:</p>

<pre><code>PDF Test File
N Congratulations, your computer is equipped with a PDF (Portable Document Format)
N reader! You should be able to view any of the PDF documents and forms available on
N our site. PDF forms are indicated by these icons:
N or.
</code></pre>

<p>But instead, this code:</p>

<pre><code>$output = file_get_contents($random_name . ".txt");
$outputTrimmed = trim($output, "\n");
echo "&lt;pre&gt;";
echo str_replace("\n", "\nN ", $outputTrimmed);
echo "&lt;/pre&gt;";
</code></pre>

<p>Results in:</p>

<pre><code>PDF Test File
N Congratulations, your computer is equipped with a PDF (Portable Document Format)
N reader! You should be able to view any of the PDF documents and forms available on
N our site. PDF forms are indicated by these icons:
N or.
N 
N 
</code></pre>

<p>What am I doing wrong? It's probably something <em>really</em>, <em>really</em> simple... so I apologize.</p>
