<?php
$context = <<< EOB
PHP is a versatile scripting language, which is mostly used to solve the web
problem. PHP is not a drug, and it is not a Philippine currency, but chicks
dig it. Ok, perhaps chicks don't really dig it, and it is actually a currency,
but it is still cool.
EOB;
$url = 'http://search.yahooapis.com/ContentAnalysisService/V1/termExtraction';
$post = "query=tool&appid=rlerdorf&context=".rawurlencode($context);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$xml = simplexml_load_string(curl_exec($ch));
curl_close($ch);
echo "<pre>".print_r($xml,1)."</pre>";
?>