phantom552 Posted January 7, 2013 Share Posted January 7, 2013 My brain is currently at it's threshold for processing this sort of thing on it's own, and I've been circling this challenge for hours with no success. Is there a way to take a JSON file (http://us.battle.net/auction-data/6de1a23eb7316db413a62771c8f16b93/auctions.json) And turn it into something I can use with PHP to reorganize and display the data in a way that makes sense? IE: Realm - Player Name - Item ID - Quantity - Bid - Buyout - Timeleft Preferrably in a CSV or MySQL DB so I ca simply foreach() the entire thing I apologise if I am not making a whole lot of sense, I am just at my wit's end. Quote Link to comment https://forums.phpfreaks.com/topic/272792-json-to-something-usable/ Share on other sites More sharing options...
haku Posted January 7, 2013 Share Posted January 7, 2013 json_decode() Quote Link to comment https://forums.phpfreaks.com/topic/272792-json-to-something-usable/#findComment-1403867 Share on other sites More sharing options...
phantom552 Posted January 7, 2013 Author Share Posted January 7, 2013 <?php $json = file_get_contents('http://us.battle.net/auction-data/6de1a23eb7316db413a62771c8f16b93/auctions.json'); var_dump($json); var_dump(json_decode($json)); ?> Returns: bool(false) NULL Quote Link to comment https://forums.phpfreaks.com/topic/272792-json-to-something-usable/#findComment-1403878 Share on other sites More sharing options...
haku Posted January 7, 2013 Share Posted January 7, 2013 That generally means that the jSON is not valid. Quote Link to comment https://forums.phpfreaks.com/topic/272792-json-to-something-usable/#findComment-1403886 Share on other sites More sharing options...
Christian F. Posted January 7, 2013 Share Posted January 7, 2013 Slight correction, as the "bool(false)" seems to be the result from file_get_contents (). Which means that it failed, and that you should check the error logs for the reason (or enable error reporting on your development system). Quote Link to comment https://forums.phpfreaks.com/topic/272792-json-to-something-usable/#findComment-1403891 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.