How can I access a multidimentional php array in javascript?
<p>The code is like this:</p>

<pre><code>&lt;SCRIPT LANGUAGE="JavaScript"&gt;
     function showReview(){
      //javascript stuff
         &lt;?php
            $http="obj.href ='http://localhost/PROJECT1/thispage.php'"; 
               if (array_key_exists(0, $arr)){
            $http .= "+'&amp;PQID={$arr[0]['ID']}'+
                     '&amp;PQNo={$arr[0]['QNo']}'+
                     '&amp;PNextSWF={$arr[0]['NextSWF']}';";
            }
            echo $http; 
           ?&gt;

        }
&lt;/SCRIPT&gt;
</code></pre>

<p>But I can't access <code>$arr</code> array. I tried to declare it global or use the <code>$GLOBALS</code> variable.</p>

<p>Show Review is called during onclick.
<code>$arr</code> is set in the main php code.
I tried just accessing the array in the main php code and passing the resulting string to the javascript which is the  '?&amp;PQID=ar&amp;PQno=1...' part of the URL but it doesn't pass successfully. I tried passing the array itself to the javascript but js but I couldn't access the contents.</p>
