Jump to content

php and xml


fogofogo

Recommended Posts

Hello all

I am having a bit of trouble selecting a value from xml.

 

The format of the xml is like this

 

<newplayer>

  <transaction result="OK"/>

  <username>Jimbo</username>

</newplayer>

 

I am able to print out the value between the username nodes. I just cant figure out how to check what the falue is for result in transaction.

 

I am using this code at the moment...

 

function sendRegistrationPlaytech($URLString)

{

$url = "https://newplayer.php?" . $URLString;

$ch = curl_init();

 

// set curl options

curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt ($ch, CURLOPT_POST, 1);

//curl_setopt ($ch, CURLOPT_POSTFIELDS, $form);

curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

$content = curl_exec ($ch); # This returns HTML

 

curl_close ($ch);

return $content;

}

 

Any help would be great

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/204299-php-and-xml/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.