主页
PHP
PHP 和 JSON
tryphp_json_decode5
运行 ❯
×
更改方向
保存代码
更改主题
<!DOCTYPE html> <html> <body> <?php $jsonobj = '{"Peter":35,"Ben":37,"Joe":43}'; $obj = json_decode($jsonobj); foreach($obj as $key => $value) { echo $key . " => " . $value . "<br>"; } ?> </body> </html>
Peter => 35
Ben => 37
Joe => 43