Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>parse json</title>
- </head>
- <body>
- <?php
- $json = '[{"status":"ok","address":"tw","user":{"tel":"0911123456"}}]';
- $ResultArray = json_decode($json,true);
- foreach($ResultArray as $arr) {
- print $arr['status'];
- print "<br>";
- print $arr['address'];
- print "<br>";
- print $arr['user']['tel'];
- print "<br>";
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment