Linked in xml response to php variables -
this question has answer here:
- how parse , process html/xml in php? 27 answers
i getting result linked in connect script,
<person> <email-address>xzenia1@gmail.com</email-address> <picture-url>http://m3.licdn.com/mpr/mprx/0_uihhf6sif4yuberhukfufkshfpomuirhmbpbf5iy4soyk7fecl4xtlxtdael42axsho9hgzdtrbl</picture-url> </person>
this php call
$xml_response = $linkedin->getprofile("~:(email-address,picture-url)");
how make them assign separate php variable.
you can load xml string simplexml_load_string
, loop in data
$xml = simplexml_load_string($xml_response); foreach($xml $key => $val) { echo "$key=>$val<br>" . "\n"; }
this output
email-address=>xzenia1@gmail.com picture-url=>http://m3.licdn.com/mpr/mprx/0_uihhf6sif4yuberhukfufkshfpomuirhmbpbf5iy4soyk7fecl4xtlxtdael42axsho9hgzdtrbl
Comments
Post a Comment