PHP 5.2 & JSON

<?php
$response[] = array('u' => $x['user_id'], 'n' => $x['name'], 't' => $x['time'], 'c' => $x['chat'] );

?>

<script type="text/javascript">

var xxx = eval(<?php print json_encode($response); ?>);

</script>

沒有留言: