Linked in xml response to php variables -


this question has answer here:

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 

live sample


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -