PHP中输出json的值

<?php $json = '{"report":{"date":"2012-04-10","content":"abcdefght"}}'; $arr = (array) json_decode($json,true); echo '当前日期是:'. $arr['report']['date']; echo "
"; echo '
';
  print_r($arr);
echo '
'; foreach($arr as $arrvalue) { foreach($arrvalue as $key=>$value) { echo "[$key] = $value
"; } } echo "
"; ?>

猜你喜欢

转载自blog.csdn.net/cmj8043719242/article/details/83010064