3

I am trying to resolve this issue as I connected with linkedin and trying to access following xml object in php to print out and access just names.

XML output:

SimpleXMLElement Object(
    [id] => MFNqBCcdLOLO
    [first-name] => James
    [last-name] => Bond
    [picture-url] => https://media.licdn.com/mpr/mprx/0_ljsdflkdsjfkjflkds
)

and my php code to print above is:

    $response = $OBJ_linkedin->profile('~:(id,first-name,last-name,picture-url)');
    print_r($response);
    if($response['success'] === TRUE) {
       $response['data'] = new SimpleXMLElement($response['linkedin']);
       //insert data...to linkedin_userprofile table...
       $linkedin = new Linkedinprofile();
            
       echo "<pre>" . print_r($response['data'], TRUE) . "</pre>";
                

Now if someone will help:

$response['data'] print the output now how I can access $response['data'][first-name] like that.

vinzee
  • 17,022
  • 14
  • 42
  • 60
Jimil
  • 626
  • 1
  • 13
  • 32

0 Answers0