日期:2014-05-16 浏览次数:20373 次
<?php
//{"1393257600":{"nums":6,"price":"2820"},"1393344000":{"nums":8,"price":"2820"},"1393430400":{"nums":3,"price":"2820"},"1393516800":{"nums":4,"price":"2820"}}
$arr = array('1393257600'=>array('nums'=>6,"price"=>'2820'),
'1393344000'=>array('nums'=>8,"price"=>'2820'),
'1393430400'=>array('nums'=>3,"price"=>'2820'),
'1393516800'=>array('nums'=>4,"price"=>'2820'),
);
$json = json_encode($arr);
?>
<html>
<head>
<script language="JavaScript" type="text/javascript">
var jsPrice = new Array();
jsPrice = <?php echo $json;?> ;
alert(jsPrice['1393257600']['price']);
alert(jsPrice['1393257600']['nums']);
</script>
</head>
<body>
</body>
</html>