标签:javascript php array
PHP:
<?php $info = [‘name‘=>‘xxx‘, ‘age‘ => 10, ‘number‘ => 191314]; echo json_encode($info); ?>
js
<script type="text/javascript"> var info = JSON.parse(‘{$info}‘); $.each(info, function(key, value) { console.log(key + ‘,‘ + value); }); </script>
标签:javascript php array
原文地址:http://smileyf.blog.51cto.com/11112339/1762872