Jump to content

simplexml of gigablast search engine


etrader

Recommended Posts

According to the instruction provided by in http://www.gigablast.com/searchfeed.html#output gigablast provides a normal xml which can be read as

<response>
    <result>
         <title>
         </title>
    </result>
</response>

 

but when checking an example xml page like http://www.gigablast.com/search?q=korn&raw=9, it is a text file without attributes, and I was unable to read it as array by simplexml_load_file.

:-\

 

Link to comment
https://forums.phpfreaks.com/topic/225262-simplexml-of-gigablast-search-engine/
Share on other sites

"Text file without attributes"? What?

It's definitely XML content, and the server says it's text/xml too...

$xml = new SimpleXMLElement("http://www.gigablast.com/search?q=korn&raw=9", 0, true);
echo (string)$xml->result[0]->sum;

Yes, it is xml but somehow different. How can I turn it into array? when doing

$xml = simplexml_load_file("http://www.gigablast.com/search?q=korn&raw=9");
print_r($xml);

The result is

SimpleXMLElement Object ( [hits] => 1033508 [moreResultsFollow] => 1 [result] => Array ( [0] => SimpleXMLElement Object ( [title] => SimpleXMLElement Object ( ) [sum] => SimpleXMLElement Object ( ) [url] => 
...

As you see, instead of actual words of title it shows "[title] => SimpleXMLElement Object ( )"

 

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.