0

I have the following code:

$search = trim($_GET["q"]);
$url = "http://www.google.com/search?meta=&q=" . $search;
$gdymresult = file_get_contents($url);

if ($gdymresult != false) {
    if (preg_match_all("/class\\=spell\\>(.*?)\\<\\/a\\>/i", $gdymresult, $matches)) {
        $gdymresult = $matches[1][0];
    }
    else {
        // the spelling is correct
    }
}
else {
    // error downloading
}

And with the preg_match_all, I want to get the value of the i inside the spell class tag, which contains the suggested word with correct spelling. But this always returns false, so it means that preg_match_all has no occurrencies.

Arun Kumaresh
  • 6,211
  • 6
  • 32
  • 50
Chona Pardo
  • 25
  • 2
  • 9

1 Answers1

0

I get this result by using your code enter image description here

so, i dont know what are you checking in your if else condition Could you please be more clear?

Imran Ali
  • 63
  • 6