Jump to content

grabbing a number form a line


Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...