Im trying to move Js variable into php , simply put var i instead of const 4
var ntime = '<?php echo count($czasAr);?>';
for (var i = 0; i < ntime; i++) {
alert('<?php echo $czasAr["4"];?>');
};
I have tried
<script>document.write(i)</script>
but it didn't work, alert was empty. any ideas?