smugmug.images.get output questions
kansaschuck
Registered Users Posts: 50 Big grins
smugmug.images.get returns image numbers in an array with the key being the image number?
[Images] => Array
(
[109589275] => Array
(
[id] => 109589275
)
[115701415] => Array
(
[id] => 115701415
)
if I want a script to loop thru 30+ images in the album how would I address the elements by a key? I'm not sure how to work/address each image in this array.
Thanks... Chuck
[Images] => Array
(
[109589275] => Array
(
[id] => 109589275
)
[115701415] => Array
(
[id] => 115701415
)
if I want a script to loop thru 30+ images in the album how would I address the elements by a key? I'm not sure how to work/address each image in this array.
Thanks... Chuck
0
Comments
I am using the JSON api and javascript, but something similar should exist for php...
So you use a for...in loop to iterate each element.
EDIT...it's foreach for PHP..
Cheers,
David
SmugMug API Developer
My Photos
David, Thanks!
I had been looking and using foreach but did a deeper look at it.
I understood the $key needed to be supplied by the users. and so I was try to define the $key from the array.....but it's filled in by the function and it just the info from the array I needed.
learning,
thanks again...
Chuck