Hi,
if you dont have curl support in your php installation and you are running on linux/unix you might try lynx to get the contents:
I tried that url. It takes rather long until the site returns a result if nothing could be found. if your query array is very large this will result in the execution limit being exceeded. There's nothing you can do about that than increasing the time limit.
<?PHP
$query = 'Free Tools asdfgae';
$query_exploded=explode(" ",$query);
function you_searched_for($query_exploded) {
for($i=0;$i<count($query_exploded);$i++){
$url = "http://dictionary.reference.com/search?q=$query_exploded[$i]";
ob_start();
passthru("/usr/bin/lynx -source $url");
$content = ob_get_contents();
ob_end_clean();
if (strstr($content,"No entry found for")) {
echo "$query_exploded[$i]<br>\\n";
} else {
echo "<a href=\\"$url\">".$query_exploded[$i]."</a><br>\\n";
}
flush();
}
}
you_searched_for($query_exploded);
?>
Since the site seems to support a query about all search terms you can try:
<?PHP
$query = 'Free Tools asdfgae';
function you_searched_for($query) {
$url = "http://dictionary.reference.com/search?q=".urlencode($query);
ob_start();
passthru("/usr/bin/lynx -source $url");
$content = ob_get_contents();
ob_end_clean();
if (strstr($content,"suggestions found")) {
echo "<a href=\\"$url\\">".$query."</a><br>\\n";
} else {
print "$query_exploded[$i]<br>\\n";
}
flush();
}
you_searched_for($query);
?>
If you do not have lynx try the above with fopen again. It should be faster then requesting the url for each search word separately.
I tested the above code and it worked for me.