Created
June 23, 2019 13:26
-
-
Save maythiwat/f86009b09b32af0bade7cd844a15f7ec to your computer and use it in GitHub Desktop.
Google Search Suggestion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = 'https://suggestqueries.google.com/complete/search?output=toolbar&hl=th&q='; | |
$url = $url . urlencode('orn bnk48'); | |
$data = utf8_encode(file_get_contents($url)); | |
$data = simplexml_load_string($data); | |
$sugg = (array)$data->CompleteSuggestion; | |
foreach($sugg as $key => $elem){ | |
echo "{$key} {$elem->suggestion->attributes()->data} \n"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment