Need help modifying javascript (inserting a php value into it)
<p>Got this javascript that reads data (urls) from a txt file, then puts each url in a frame, calculates how much time it took to load that url in iframe, then display the result into html <code>div</code>.</p>

<p>Here is the code:</p>

<pre><code>&lt;script type="text/javascript"&gt;
   $.get("imones.txt", function (data) {
        var array = data.split(/\r\n|\r|\n/);
        var beforeLoad = (new Date()).getTime(); 
        var loadTimes = []; 
            var beforeTimes = [];               
        $('#frame_id').on('load', function () {                                 
            beforeTimes.push(beforeLoad);
            loadTimes.push((new Date()).getTime()); 
            $('#frame_id').attr('src', array.shift());
                try {
                $.each(loadTimes, function (index, value) { 
                    var result = (value - beforeTimes[index]) / 1000; 
                        if (result &lt; 0) { 
                            result = result * (-1);
                        }
                    $("#loadingtime" + [index]).html(result);                       
                    beforeLoad = value; 
                });
                } catch(ex) {}
        }).attr('src', array.shift()); 
    });
&lt;/script&gt;
</code></pre>

<p>imones.txt has data written in it like so - <code>example1.com, example2.com</code> and so on. Instead of reading this <code>imones.txt</code> file, i want to replace it with an php array:</p>

<pre><code>$url_array = array();
$url_array[] = 'example1.com';
$url_array[] = 'example2.com';
</code></pre>

<p>And then instead of displaying the result into html div (<code>$("#loadingtime" + [index]).html(result);</code>) i want to put that result into another php array:</p>

<pre><code>$php_array[] = $("#loadingtime" + [index]).html(result);
</code></pre>

<p>Can someone help me do this?</p>
