hi there,
I am working on getting a search page to cache it's results to speed up searches that have already been done. Originally, I was running into the problem of not being able to serialize/unserialize the simpleXMLElements...so I took the approach of converting the original results from the simpleXML to stdClass. Now the problem I have is that when I try to display the results from cache (they are stdClass objects), they won't display with echo/print ... but all the data is correct if I use print_r. The simpleXMLElement objects that are used the first time a search is done all display correctly.
For example:
foreach ($resultset->results as $result) {
echo $result->title;
}
displays absolutely nothing if I am trying to use the stdClass object ($resultset is a SearchResult object, results is an array of stdClass objects), and displays the title correctly if I am using the simpleXMLElement.
Please clarify this for me...I don't see why they should act any differently...?
Oh, and print_r($result) in the above loop displays:
SearchResultYahoo Object ( [title] => stdClass Object ( [0] => title of result) [excerpt] => stdClass Object ( [0] => info about the result ) [modified] => stdClass Object ( [0] => date last modified ) [url] => stdClass Object ( [0] => the url to a site ) [size] => stdClass Object ( [0] => 167080 ) [attributes] => Array ( ) [mime_type] => stdClass Object ( [0] => application/pdf ) )
So I know that the title, url, etc are all there...
Thanks for any help!