Extracted Terms"; foreach ($arrTerms as $term) { echo $term . '
'; } function YahooTermExtractor ($context) { // ------------------------------------------------------------------// // ------------------------------------------------------------------// // -- Your API key. You can get this at http://developer.yahoo.com -- // $appid = ''; // ------------------------------------------------------------------// // ------------------------------------------------------------------// // Documentation available at: http://developer.yahoo.com/search/content/V1/termExtraction.html $url = 'http://search.yahooapis.com/ContentAnalysisService/V1/termExtraction'; $context = urlencode($context); $postfield = 'appid='.$appid. '&' .'context='.$context; $ch = curl_init($url); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postfield); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $target = curl_exec($ch); curl_close($ch); // Place the results into an XML string $simple_xml=simplexml_load_string($target); $arrTerms = array(); for ($i = 0; $i < count($simple_xml->Result); $i++) { $arrTerms[$i] = $simple_xml->Result[$i]; } return $arrTerms; } ?>