How to implode JavaScript into PHP's return function?
<p>I have a PHP function:</p>

<pre><code>function output_errors($errors) {
    return '&lt;ul&gt;&lt;li&gt;' . implode('&lt;/li&gt;&lt;li&gt;', $errors) . '&lt;/li&gt;&lt;/ul&gt;';
}
</code></pre>

<p>But instead of <code>&lt;ul&gt;</code> and <code>&lt;li&gt;</code>s I wish to use jQuery to show errors:</p>

<pre><code>$(function() {
    $.pnotify({
        title: 'Update Successful!',
        text: '&lt;p&gt;Error text here!&lt;/p&gt;',
    });
});
</code></pre>

<p>I tried a lot of combinations but it doesn't work.</p>
