Hi,
if you want to achieve this function,you need to use ajax.
your php side(a.php)
$amData=array(1,2,3,4);
$amJSONArray = json_encode($amData);
echo $amJSONArray;
?>
your js side(b.html)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
$.getJSON("a.php",function(result){
$.each(result,function(i,j){
alert(j);
});
});
})
</script>
try this,you will get the array from php side