1

I need to pull out the [name] information only from this array that includes php stdClass Objects. How do I do this please?

Array ( [VigdiH] => stdClass Object ( [ip] => 555.50.175.142 [name] => Test Name [origin] => www [cycle_day] => 3 [email] => [email protected] [campaign] => 5555 [created_on] => 2014-03-28 14:22:58 [changed_on] => ))

2 Answers 2

3

If your array is named $arr you could do:

foreach($arr as $object) {
    echo $object->name . "\n";
}
Sign up to request clarification or add additional context in comments.

Comments

2

You can get properties from an object using ->

$data = array(/**/);
$data["VigdiH"]->name; // name

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.