print_r with string concatenation
<p>I tried to write the content of an Array to screen with <code>print_r</code>. The first snippet of code gives the correct output, but the second snippet of code that does the same thing with string concatenation displays the content of the Array on one line. Why is this?</p>

<blockquote>
  <p>My code 1:</p>
</blockquote>

<pre><code>echo "&lt;pre&gt;";
echo print_r($mixed_array);
echo "&lt;/pre&gt;";
</code></pre>

<blockquote>
  <p>Result 1:</p>
</blockquote>

<pre><code>Array
(
    [0] =&gt; 6
    [1] =&gt; fox
    [2] =&gt; dog
    [3] =&gt; Array
        (
            [0] =&gt; x
            [1] =&gt; y
            [2] =&gt; z
        )

)
1
</code></pre>

<blockquote>
  <p>My code 2:</p>
</blockquote>

<pre><code>echo "&lt;pre&gt;".print_r($mixed_array)."&lt;/pre&gt;";
</code></pre>

<blockquote>
  <p>Result 2:</p>
</blockquote>

<pre><code>Printing Array: Array ( [0] =&gt; 6 [1] =&gt; fox [2] =&gt; dog [3] =&gt; Array ( [0] =&gt; x [1] =&gt; y [2] =&gt; z ) )

1
</code></pre>