send array using jquery
<p>i have a variable   $visitRecord->getReferallist() which get the list of doctors in an array . i need to send the array to a php file and do foreach action in php file.. how do i send this array variable in the jquery . This code did not work.</p>

<pre><code> function seekOpinion()
    {
    var queryUrl = "&lt;?php echo $this-&gt;url(array('controller' =&gt; 'consultant', 'action' =&gt;'opiniondoclist'));?&gt;";
    $.post(queryUrl,{referal:'&lt;?php echo $gotreferal; ?&gt;',visitId:'&lt;?php echo $gotvisitId; ?&gt;',referalList:'&lt;?php echo $visitRecord-&gt;getReferallist(); ?&gt;'},function(data)
    {
            $('.opiniondoclistData').html(data);
    });
            document.getElementById('opiniondoclistDiv').style.display = "";
    }
</code></pre>
