Created
March 28, 2011 03:56
-
-
Save saturngod/889982 to your computer and use it in GitHub Desktop.
google spell check api
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 | |
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; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
not working anymore.