jasber Posted July 6, 2012 Share Posted July 6, 2012 (edited) Hi, Need help with one thing.How to i get one number form a long line. Link where is the numbers: http://services.rune...graph/4151.jsonPicture: If you scroll to the end you can see that.I really could use your help how to get only this number to show on a site. Than you Edited July 6, 2012 by jasber Link to comment Share on other sites More sharing options...
justsomeguy Posted July 6, 2012 Share Posted July 6, 2012 Since that's already in JSON format then you should convert it to an array first. Then you can use the array_keys function to get the list of keys in the "daily" array, get the last key, and use that to look up the last item in the array. http://www.php.net/manual/en/function.json-decode.phphttp://www.php.net/manual/en/function.array-keys.php e.g.: $array = json_decode($json, true);$keys = array_keys($array['daily']);$value = $array['daily'][$keys[count($keys) - 1]]; Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now