<toplevel>
<CompleteSuggestion>
<suggestion data="shook ones part 2"/>
</CompleteSuggestion>
<CompleteSuggestion>
<suggestion data="shook me all night long"/>
</CompleteSuggestion>
<CompleteSuggestion>
<suggestion data="shook ones instrumental"/>
</CompleteSuggestion>
<CompleteSuggestion>
<suggestion data="shook me all night long lyrics"/>
</CompleteSuggestion>
</toplevel>
I want to extract "shook ones part 2" from this XML output. I have gone through every solution, but I'm unable to do this. I tried this:
<?php
$url = 'http://suggestqueries.google.com/complete/search?output=toolbar&hl=en&q=shook&ds=yt';
$exact = simplexml_load_file($url);
echo $exact->CompleteSuggestion[0]->suggestion;
?>