I'm not sure if I'm just being silly, although I wasn't able to find this anywhere, but I am json_encode()ing some database outputs and outputting them to the page, and reading them using $.parseJSON, but I want to get a specific value from the array. Here is an example of what I'm trying to accomplish.
var j = '[{"uid":"1","name":"Bingo Boy", "profile_img":"funtimes.jpg"},{"uid":"2","name":"Johnny Apples", "profile_img":"badtime.jpg"}]';
var json = $.parseJSON(j);
$(json).each(function(i, val) {
$.each(val, function(k, v) {
console.log(k['uid']) // <-- This is where I want to just output the UID from each array results
});
Now, to put into words what I'd like to accomplish is to just pull the UID (or name or profile_img, just a value in general) from this array, so I can later insert the values into a div.
Any help is much appreciated, thank you!