I found a JSON file and I would like to use it for my PHP website, but I have never seen the JSON filetypes before, so i need help on how to implement it. The JSON file is (http://halocharts.com/2012/json_challenges.php).
Asked
Active
Viewed 47 times
-4
-
4RTFM: http://php.net/manual/en/book.json.php – Marc B Jun 11 '13 at 21:15
-
`json_decode(file_get_contents("http://halocharts.com/2012/json_challenges.php"));` – Daryl Gill Jun 11 '13 at 21:15
-
possible duplicate of [PHP - JSON Data Parsing](http://stackoverflow.com/questions/2067544/php-json-data-parsing) – mario Jun 11 '13 at 21:16
-
Hi there. Just so you know, if you ask too many questions that are downvoted and closed, your account may be restricted from asking new questions. Please refer to the FAQ to see what makes a good question here, and do _always_ search and research before you ask. – halfer Jun 11 '13 at 22:15
1 Answers
1
Try this:
<?php
$raw=file_get_contents("http://halocharts.com/2012/json_challenges.php");
$raw=json_decode($raw,true);
Now you can access $raw
at DailyChallenges
with $raw['DailyChallenges']
.

Dave Chen
- 10,887
- 8
- 39
- 67