-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,329
  • 12
  • 52
  • 68
Narayan Srivathsan
  • 505
  • 1
  • 4
  • 3

1 Answers1

0

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

$sourceArray['result']['Referral_Code']
BeetleJuice
  • 37,029
  • 18
  • 91
  • 152