PHP编程实战15-1

2015-11-09  本文已影响0人  海边拾贝
<!--PHP编程实战-->
<!--JSON & Ajax -->
<!--15-1-->
<!--将PHP数据类型编码为JSON格式,再解码为PHP数据类型-->
<?php
$php_data_types = array(4.1, 3, NULL, true, false, "hello", new stdClass(), array());
$json = json_encode($php_data_types);
$decoded = json_decode($json);
echo "JSON(字符串)表示:<br />";
var_dump($json);
echo "<br />PHP表示:<br />";
var_dump($decoded);
?>
上一篇下一篇

猜你喜欢

热点阅读