PHP - how to print newline?
<p>I'm a beginner in PHP. I'm trying to print a newline (<code>\n</code>) after each row of my XML. </p>

<pre><code>$xml = '&lt;items&gt;';
    while ($row = mysqli_fetch_assoc($result)) {
        $xml = $xml.'&lt;product&gt;';
        foreach ($row as $key =&gt; $val) {
            $xml = $xml . "&lt;$key&gt;$val &lt;/$key&gt;";
        }
        $xml = $xml . '&lt;/product&gt;';
        PHP_EOL;
    }
    $xml = $xml . '&lt;/items&gt;';
</code></pre>

<p>But it gives me an output like this:</p>

<pre><code>1 Coca-cola Can 5 30 100 pcs 2 Sprite 5 50 10 pcs 3 Fanta 5 100 20 pcs
</code></pre>

<p>I want an output like:</p>

<pre><code>1 Coca-cola Can 5 30 100 pcs
2 Sprite 5 50 10 pcs
3 Fanta 5 100 20 pcs
</code></pre>

<p>I have tried many variations and have seen many answers, but none worked for me. Please help.</p>