Results 1 to 3 of 3
Sep 28, 2011, 15:00 #1
Displaying XML Data Stored in a PHP Variable
I'm currently trying to pull data from the Playstation 3's PSN API and I'm not entirely sure what I'm doing.
Here is my code, saved as trophycount.php.
$url = "http://www.psnapi.com.ar/ps3/api/psn.asmx/getPSNID";
$username = "vlastanovak";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_POSTFIELDS, "sPSNID=$username");
$data = curl_exec($ch);
How can I display specific data from the XML feed?
Also, when I change the echo $data line to return $data, the source becomes blank?
Thanks in advance!