<?php 
$a    =array('1','2','3');
?>





<script language="javascript">
var obj    =eval('<?php echo json_encode($a);?>');
alert(obj[0]);
alert(obj[1]);
alert(obj[2]);
</script>



本文转载:CSDN博客