Member Avatar for TechySafi
<?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?

Member Avatar for diafol

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.

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 />';
		}
Member Avatar for diafol
<?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.

Member Avatar for TechySafi

@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!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.