How can I get the value from an array?
Hi guys...
So I have a silly little problem, and I feel like, at my stage as a Dev, I should know to be common sense... But i'm stuck...
I have this array:
[0] => stdClass Object
(
[#text] => http://userserve-ak.last.fm/serve/34/49285167.jpg
[size] => small
)
But I don't know how to get the value for the "[#text]" key, as it has the hash symbol...
How do I get this value?
The array is returned as an object, from json.
Thanks in advance
All the best news here: https://newsbotnet.com
DarkLight posted this at 22:34 — 26th February 2012.
He has: 287 posts
Joined: Oct 2007
Nevermind, I found out
$object->{'#text'}
JeevesBond posted this at 02:41 — 27th February 2012.
He has: 3,956 posts
Joined: Jun 2002
Glad you found it and thanks for coming back and updating the thread with the answer!
uoftenwinny posted this at 09:07 — 28th February 2012.
They have: 80 posts
Joined: Sep 2011
Good job.LOL
DarkLight posted this at 11:06 — 29th February 2012.
He has: 287 posts
Joined: Oct 2007
Welcome, and Thanks Still think it's a strange way to build an array though...
Greg K posted this at 08:16 — 10th May 2012.
He has: 2,145 posts
Joined: Nov 2003
Just for clarification, that is an object, not an array.
-Greg
DarkLight posted this at 11:41 — 10th May 2012.
He has: 287 posts
Joined: Oct 2007
-Greg
TRUE I always call them arrays, but yeah I know you're right. Its just habit.
All the best news here: https://newsbotnet.com
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.