reading a google query with simplexml
Posted: Sun May 02, 2010 3:41 pm
Hello, I'm trying to get the .xml I get from this page:
http://google.com/complete/search?outpu ... =microsoft
and print it to an html using this code:
When the .xml is an existing file the code works, but when I use the link the page is blank....
thank you for helping
http://google.com/complete/search?outpu ... =microsoft
and print it to an html using this code:
Code: Select all
<?php
$xml = simplexml_load_file('http://google.com/complete/search?output=toolbar&q=microsoft');
foreach($xml->CompleteSuggestion as $CompleteSuggestion)
{
echo '<p> '.$CompleteSuggestion->suggestion['data'].' </p>';
}
?>
thank you for helping