-2

I have my JSon output like this

Array ( 
    [status] => 1 
    [count] => 1 
    [message] => 
    [result] => Array ( 
        [User_Id] => 11 
        [Referral_Code] => xxxxx 
    ) 
    [resultList] => null
)

How do I access the referral_code object?

Thanks for the help.

Kevin
  • 41,694
  • 12
  • 53
  • 70
Narayan Srivathsan
  • 495
  • 1
  • 4
  • 3

1 Answers1

0

If you name the array you showed $sourceArray you can do:

$sourceArray['result']['Referral_Code']
BeetleJuice
  • 39,516
  • 19
  • 105
  • 165