LZ1
asked on
Echoing out PHP array vars
Hey Experts!!
Very simple and straight forward question: In my WP site, I have gotten back an array and want to know how to echo out the values I need.
Let's say I want to echo out display_name from the following:
How can I do that?
Very simple and straight forward question: In my WP site, I have gotten back an array and want to know how to echo out the values I need.
Let's say I want to echo out display_name from the following:
array(205) { [0]=> object(WP_User)#619 (7) { ["data"]=> object(stdClass)#393 (10) { ["ID"]=> string(4) "2138" ["user_login"]=> string(23) "blah@blah.com" ["user_pass"]=> string(34) "fdasfasfsfasfa" ["user_nicename"]=> string(22) "akillileawcapgroup-com" ["user_email"]=> string(23) "blah@blah.com" ["user_url"]=> string(13) "http://Alison" ["user_registered"]=> string(19) "2013-06-08 23:59:31" ["user_activation_key"]=> string(0) "" ["user_status"]=> string(1) "0" ["display_name"]=> string(6) "Alison" } ["ID"]=> int(2138) ["caps"]=>
How can I do that?
echo $yourarray[0]->display_nam e;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect thanks!