Home >Backend Development >PHP Tutorial >What methods are there in php to output the value of a json object?
This time I will show you what methods PHP can use to output the value of a json object. What are the precautions for PHP to output the value of a json object? The following is a practical case, let's take a look.
An example is as follows:
<!DOCTYPE html> <html> <body> <?php $json = '{"report":{"date":"2012-04-10","content":"abcdefght"}}'; $arr = (array) json_decode($json,true); echo '当前日期是:'. $arr['report']['date']; echo "<br/>"; echo '<pre class="brush:php;toolbar:false">'; print_r($arr); echo ''; foreach($arr as $arrvalue) { foreach($arrvalue as $key=>$value) { echo "[$key] = $value