I got a script that:
- reads urls from a txt file
- does some calculations
- inserts results into a table
I want to replace txt file with php array. Heres my current code:
<script type="text/javascript">
$.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 < 0) {
result = result * (-1);
}
$("#loadingtime" + [index]).html(result);
beforeLoad = value;
});
} catch(ex) {}
}).attr('src', array.shift());
</script>
It reads from imones.txt, then inserts each url into a frame, does some calculations, and then inserts results into #loadingtime
div. I want to replace imones.txt with a php array. Also i would like the output to be stored in another php array instead of storing it in a div. Can someone help me with this?
$array = array();
in the same file, it stores the same urls as imones.txt – Edgar Mar 18 at 12:51