0
<?xml version='1.0' encoding='UTF-8'?>
<response>
<status>get_ticket_ok</status>
<ticket>bxquuv025arztljze2n438md9zef95e8</ticket>
</response>

This is all you got! How you will convert it into php array or something?

3
Contributors
6
Replies
7
Views
6 Years
Discussion Span
Last Post by TechySafi
0

If you're using somebody else's script, use their forum. You can use SimpleXML with a string variable. I don't know where you get the file thing from.

0

This code show how to retrieve rss feed into php array.
First: Download-> magpierss from http://magpierss.sourceforge.net/
Second: Copy and paste the following code into php file.

require_once('magpierss/rss_fetch.inc');
        $url = "http://reygcalantaol.com/feed/";
        $rss = fetch_rss($url); // $rss = fetch_rss($url);
        $cnt = count($rss->items);

		//print_r($rss->items);


			
		//To access your array			

		foreach ($rss->items as $key => $item) {
			$href = htmlspecialchars_decode($item['link']);
            $title = htmlspecialchars_decode($item['title']);
            $desc = $item['description'];
					
			echo '<strong><a href="'.$href.'">'.$title.'</a></strong><br />';
			echo $desc.'<br /><br />';
		}
0
<?php
$return = "<?xml version='1.0' encoding='UTF-8'?>
<response>
<status>get_ticket_ok</status>
<ticket>bxquuv025arztljze2n438md9zef95e8</ticket>
</response>";

$xml = new SimpleXMLElement($return);
echo $xml->status;
echo $xml->ticket;
?>

Seems quite easy to me.

0

@ardav leave it, I think i'm missing something I could not make it clear to you guys.

I'm trying again to explain, in index.php im sending a REST request through url then that API returning that xml file to my callback.php page so I don't understand how to put that xml manually inside the $return variable like you did.

Their forum is DEAD so they won't help me with this issue,thats why I asked on daniweb. Do not misunderstand please.

Thanks for your efforts guys!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.