Skip to content

Instantly share code, notes, and snippets.

@saturngod
Created March 28, 2011 03:56
Show Gist options
  • Save saturngod/889982 to your computer and use it in GitHub Desktop.
Save saturngod/889982 to your computer and use it in GitHub Desktop.
google spell check api
<?php
header("Content-Type: text/xml; charset=utf-8");
$url="https://www.google.com/tbproxy/spell?lang=en";
$text = urldecode("mystary");
$body = '<!--?xml version="1.0" encoding="utf-8" ?-->';
$body .= '';
$body .= ''.$text.'';
$body .= '';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$contents = curl_exec($ch);
curl_close($ch);
print $contents;
?>
@neeldarji
Copy link

Is Google spell check API free ?

@abhishekhugetech
Copy link

not working anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment