0

I've receive a response $oResponse:

object(stdClass)[5]
  public 'transaction' =>
    object(stdClass)[6]
      public 'sId' => string '55PT1U-ELU4Z8-7RDTJY' (length=20)
      public 'sDate' => string '2012-12-13 17:32:45' (length=19)
      public 'fAmount' => int -10
      public 'sCurrency' => string 'USD' (length=3)
      public 'fFee' => int 0
      public 'sType' => string '(api) Sent to' (length=13)
      public 'iTypeId' => string '12' (length=2)
      public 'sEmail' => string '[email protected]' (length=19)
      public 'sDetails' => string 'Api send test' (length=12)
      public 'sStatus' => string 'Completed' (length=9)
  public 'status' => string 'ok' (length=2)

Then try to parse a status:

echo $oResponse->{5}->status;

But it doesn't working :(

4
  • Can you should the full var_dump()? Commented Jul 11, 2013 at 20:47
  • Ok - usual questions: What does it do? Do you get an error message in your server logs or on screen? If so, what is it? Commented Jul 11, 2013 at 20:48
  • var_dump($oResponse) return object(stdClass)#4 (2) { ["transaction"]=> object(stdClass)#5 (10) { ["sId"]=> string(20) "55PT1U-ELU4Z8-7RDTJY" ["sDate"]=> string(19) "2012-12-13 17:32:45" ["fAmount"]=> int(-10) ["sCurrency"]=> string(3) "USD" ["fFee"]=> int(0) ["sType"]=> string(13) "(api) Sent to" ["iTypeId"]=> string(2) "12" ["sEmail"]=> string(21) "[email protected]" ["sDetails"]=> string(19) "Api send test" ["sStatus"]=> string(9) "Completed" } ["status"]=> string(2) "ok" } Commented Jul 11, 2013 at 23:52
  • it's working! echo $oResponse->status; Commented Jul 11, 2013 at 23:55

1 Answer 1

1

Try to change this

echo $oResponse->status;
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.