access php array in jquery
<p>I have 4 divs and on mouseover of each, I want the <code>src</code> of an <code>img</code> to change.<br>
I have to get the images from <strong>PHP</strong>.<br>
How can I use the array that I get in <strong>PHP</strong> over in my jQquery script?<br>
And I know with just 4, I could just set up the array in javascript and put each image name, but that's not the functionality I'm looking for.</p>

<pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;

&lt;style&gt;
div{
height:100px;
width:100px;
display:inline-block;
background-color:blue;  
}
#my_image{
height:100px;
width:100px;
display:inline-block;
}

&lt;/style&gt;

&lt;?php

$images = scandir("images", 1);

?&gt;

&lt;script&gt;

$(document).ready(function(){
    $(div).mouseover(function(){
        $("#my_image").attr("src", /*my php array*/);
    });

});

&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
    &lt;div&gt;&lt;/div&gt;
    &lt;div&gt;&lt;/div&gt;
    &lt;div&gt;&lt;/div&gt;
    &lt;div&gt;&lt;/div&gt;
    &lt;img id="my_image" /&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
