0

I have an array full of stdClass objects. I just need to unserialize a specific property in one of the objects in each index. This is what i'm trying but the object is still serialized so perhaps im just referecing it wrong. How should I be reading the 'exampleData' property?

foreach ($rowset as $value) {
    $value = unserialize($value -> exampleData);
}

1 Answer 1

3
foreach ($rowset as &$value) {
    $value = unserialize($value -> exampleData);
}

You need to pass-by-reference

Sign up to request clarification or add additional context in comments.

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.