PHP string to object problem?

the result returned is as follows:

["content"]=>
  string(1624) "stdClass Object
(
    [AddResult] => stdClass Object
        (
            [Code] => 
            [Content] => stdClass Object
                (
                    [MemberId] => 101525056
                )

            [ErrorMessage] => 
            [Id] => 0
            [Success] => 1
        )

)
"

I want to convert the content content in the result ( $result ["content"] ) into an object operation, but after using (object) $result [" content"] operation, the result is as follows:

object(stdClass)-sharp1 (1) {
  ["scalar"]=>
  string(1624) "stdClass Object
(
    [AddResult] => stdClass Object
        (
            [Code] => 
            [Content] => stdClass Object
                (
                    [MemberId] => 101525056
                )

            [ErrorMessage] => 
            [Id] => 0
            [Success] => 1
        )

)
"
}

although there are objects on the outside, the content in scalar is still a string.

solve the problem, how on earth can you turn it into an object?

Mar.22,2021

cycle into obj


where did you get the data, and let him transfer the data to json and let him say


not much. Php, recently used php to write crawlers, which need to be converted into objects. I used class and then new a class


json_decode (json_encode ($std), true);

).
Menu