How can I separate the output of the web service?

  php, pointers, web-services

I get this result from web service in php code:

> stdClass Object (
>     [Post_Added_Record_ByMenuIDResult] => stdClass Object
>         (
>             [HTMLStructure] => ثبت انجام شد
>             [IsAuthenticated] => 1
>             [MenuID] => 1191
>             [Password] => 
>             [PersonID] => 27598
>             [PersonalityID] => 31413
>             [RecordValues] => 
>             [RoleID] => 5
>             [Sexuality_Title] => m
>             [UserName] => mr.piri
>         ) )

I want to get the opposite phrase in [HTMLStructure]. in this example : ثبت انجام شد

if (strstr( $result, 'HTMLStructure' ) ) {
       $HTMLStructurePos=strpos( $result, '[HTMLStructure] =>' );
       echo $HTMLStructurePos;
       $IsAuthenticatedPos=strpos( $result, '            [IsAuthenticated]' );
       echo $IsAuthenticatedPos;
       $result2 = substr($result, $HTMLStructurePos, $IsAuthenticatedPos);
  echo "<pre>";
   print_r($result2);
   echo "</pre>";
} else {
  echo "Not found";
}

but i get

Not found

in the out put.

I think this is a structure and I have to get the value with the pointer.But does anyone know how?

Source: Ask PHP

LEAVE A COMMENT