Link to home
Start Free TrialLog in
Avatar of LZ1
LZ1Flag for United States of America

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:

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"]=>

Open in new window


How can I do that?
Avatar of gr8gonzo
gr8gonzo
Flag of United States of America image

echo $yourarray[0]->display_name;
ASKER CERTIFIED SOLUTION
Avatar of gr8gonzo
gr8gonzo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of LZ1

ASKER

Perfect thanks!